<commit_before>package mytown.entities.flag;

import mytown.proxies.LocalizationProxy;

/**
 * Created by AfterWind on 9/16/2014.
 * Flags enumeration. Enumerating all flags here
 */
public enum FlagType {
    // CONSTRUCTOR: class, value, allowedValues, wildPerm, defaultWildPerm, townOnly, mod, isWhitelistable <false>

    // Allows entering the area
    enter(Boolean.class, true, null, false, true, Property.all, null),

    // Allows opening GUIs and right-clicking TileEntities
    accessBlocks(Boolean.class, false, null, true, true, Property.all, null, true),

    // Allows pickup of items.
    pickupItems(Boolean.class, true, null, true, true, Property.all, null),

    // Allows pvp
    pvp(Boolean.class, false, null, true, true, Property.all, null),

    // Only the values in the array are allowed
    // Allows modifying which types of mods are allowed in the town.
    mobs(String.class, "all", new String[]{"all", "hostiles", "none"}, true, "all", Property.all, null),

    // Allows outsiders to hurt passive and other types of entities.
    protectedEntities(Boolean.class, false, null, true, false, Property.all, null),

    // Allows the use of some items such as: Bucket, Spawn Eggs etc.
    useItems(Boolean.class, false, null, true, true, Property.all, null),

    // Allows to activate blocks such as: Buttons, Doors etc.
    activateBlocks(Boolean.class, false, null, true, true, Property.all, null, true),

    // ---- Flags that don't go in plots. ----

    // Allows modifying blocks.
    modifyBlocks(Boolean.class, false, null, true, true, Property.townOnly, null, true),

    // Allows explosions.
    explosions(Boolean.class, false, null, true, true, Property.townOnly, null),

    // Allows normal residents to have permission outside their claimed plots.
    restrictedTownPerms(Boolean.class, false, null, false, false, Property.townOnly, null),;

    private Class<?> type;
    private Object[] allowedValues;
    private Object defaultValue;
    private Property property;
    private boolean canTownsModify;
    private boolean isWhitelistable;
    private String modRequired;
    private boolean isWildPerm;
    private Object defaultWildPerm;

    private FlagType(Class<?> type, Object defaultValue, Object[] allowedValues, boolean wildPerm, Object defaultWildPerm, Property property, String modRequired, boolean isWhitelistable) {
        this.type = type;
        this.property = property;
        this.allowedValues = allowedValues;
        this.modRequired = modRequired;
        this.isWhitelistable = isWhitelistable;
        this.canTownsModify = true;
        this.defaultValue = defaultValue;
        this.isWildPerm = wildPerm;
        this.defaultWildPerm = defaultWildPerm;
    }

    private FlagType(Class<?> type, Object defaultValue, Object[] allowedValues, boolean wildPerm, Object defaultWildPerm, Property property, String modRequired) {
        this(type, defaultValue, allowedValues, wildPerm, defaultWildPerm, property, modRequired, false);
    }

    /**
     * Gets the type that the Flag that uses this FlagType stores.
     */
    public Class<?> getType() {
        return this.type;
    }

    /**
     * Returns if this flag is found in the wild.
     */<commit_msg>Flags are no longer loaded based on mods.<commit_after>package mytown.entities.flag;

import mytown.proxies.LocalizationProxy;

/**
 * Created by AfterWind on 9/16/2014.
 * Flags enumeration. Enumerating all flags here
 */
public enum FlagType {
    // CONSTRUCTOR: class, value, allowedValues, wildPerm, defaultWildPerm, townOnly, mod, isWhitelistable <false>

    // Allows entering the area
    enter(Boolean.class, true, null, false, true, Property.all, null),

    // Allows opening GUIs and right-clicking TileEntities
    accessBlocks(Boolean.class, false, null, true, true, Property.all, null, true),

    // Allows pickup of items.
    pickupItems(Boolean.class, true, null, true, true, Property.all, null),

    // Allows pvp
    pvp(Boolean.class, false, null, true, true, Property.all, null),

    // Only the values in the array are allowed
    // Allows modifying which types of mods are allowed in the town.
    mobs(String.class, "all", new String[]{"all", "hostiles", "none"}, true, "all", Property.all, null),

    // Allows outsiders to hurt passive and other types of entities.
    protectedEntities(Boolean.class, false, null, true, false, Property.all, null),

    // Allows the use of some items such as: Bucket, Spawn Eggs etc.
    useItems(Boolean.class, false, null, true, true, Property.all, null),

    // Allows to activate blocks such as: Buttons, Doors etc.
    activateBlocks(Boolean.class, false, null, true, true, Property.all, null, true),

    // ---- Flags that don't go in plots. ----

    // Allows modifying blocks.
    modifyBlocks(Boolean.class, false, null, true, true, Property.townOnly, null, true),

    // Allows explosions.
    explosions(Boolean.class, false, null, true, true, Property.townOnly, null),

    // Allows normal residents to have permission outside their claimed plots.
    restrictedTownPerms(Boolean.class, false, null, false, false, Property.townOnly, null),;

    private Class<?> type;
    private Object[] allowedValues;
    private Object defaultValue;
    private Property property;
    private boolean canTownsModify;
    private boolean isWhitelistable;
    private boolean isWildPerm;
    private Object defaultWildPerm;

    private FlagType(Class<?> type, Object defaultValue, Object[] allowedValues, boolean wildPerm, Object defaultWildPerm, Property property, String modRequired, boolean isWhitelistable) {
        this.type = type;
        this.property = property;
        this.allowedValues = allowedValues;
        this.isWhitelistable = isWhitelistable;
        this.canTownsModify = true;
        this.defaultValue = defaultValue;
        this.isWildPerm = wildPerm;
        this.defaultWildPerm = defaultWildPerm;
    }

    private FlagType(Class<?> type, Object defaultValue, Object[] allowedValues, boolean wildPerm, Object defaultWildPerm, Property property, String modRequired) {
        this(type, defaultValue, allowedValues, wildPerm, defaultWildPerm, property, modRequired, false);
    }

    /**
     * Gets the type that the Flag that uses this FlagType stores.
     */
    public Class<?> getType() {
        return this.type;
    }

    /**
     * Returns if this flag is found in the wild.
     */
{'fraction_non_alphanumeric': 0.10146053449347421, 'fraction_numerical': 0.002175264139216905, 'mean_word_length': 3.3729619565217392, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7384520', 'n_tokens_mistral': 1856, 'n_tokens_neox': 1769, 'n_words': 618}