Enum Class ControlFlag

java.lang.Object
java.lang.Enum<ControlFlag>
me.tayebyassine.homestead.flags.ControlFlag
All Implemented Interfaces:
Serializable, Comparable<ControlFlag>, Constable

public enum ControlFlag extends Enum<ControlFlag>
Enum representing control flags for region management permissions.

Control flags govern administrative actions that members can perform within a region, such as managing other players, modifying region settings, and handling finances. Each flag is represented as a unique bit in a 64-bit integer.

See Also:
  • Enum Constant Details

    • TRUST_PLAYERS

      public static final ControlFlag TRUST_PLAYERS
      Allows trusting players to the region.
    • UNTRUST_PLAYERS

      public static final ControlFlag UNTRUST_PLAYERS
      Allows untrusting players in the region.
    • BAN_PLAYERS

      public static final ControlFlag BAN_PLAYERS
      Allows banning players from the region.
    • UNBAN_PLAYERS

      public static final ControlFlag UNBAN_PLAYERS
      Allows unbanning previously banned players.
    • CLAIM_CHUNKS

      public static final ControlFlag CLAIM_CHUNKS
      Allows claiming new chunks for the region.
    • UNCLAIM_CHUNKS

      public static final ControlFlag UNCLAIM_CHUNKS
      Allows unclaiming chunks from the region.
    • DEPOSIT_MONEY

      public static final ControlFlag DEPOSIT_MONEY
      Allows depositing money into the region bank.
    • WITHDRAW_MONEY

      public static final ControlFlag WITHDRAW_MONEY
      Allows withdrawing money from the region bank.
    • SET_GLOBAL_FLAGS

      public static final ControlFlag SET_GLOBAL_FLAGS
      Allows setting global flags that affect all regions.
    • SET_WORLD_FLAGS

      public static final ControlFlag SET_WORLD_FLAGS
      Allows setting world-specific flags for the region.
    • SET_MEMBER_FLAGS

      public static final ControlFlag SET_MEMBER_FLAGS
      Allows setting member-specific flags (player flags) for region members.
    • SET_SPAWN

      public static final ControlFlag SET_SPAWN
      Allows setting the region's spawn point.
    • MANAGE_SUBAREAS

      public static final ControlFlag MANAGE_SUBAREAS
      Allows creating and managing subareas within the region.
    • RENAME_REGION

      public static final ControlFlag RENAME_REGION
      Allows renaming the region.
    • SET_DESCRIPTION

      public static final ControlFlag SET_DESCRIPTION
      Allows setting the region's description.
    • MANAGE_LOGS

      public static final ControlFlag MANAGE_LOGS
      Allows managing region logs (viewing, clearing).
    • KICK_PLAYERS

      public static final ControlFlag KICK_PLAYERS
      Allows kicking players from the region.
    • SET_WEATHER_AND_TIME

      public static final ControlFlag SET_WEATHER_AND_TIME
      Allows setting the region's weather and time.
  • Method Details

    • values

      public static ControlFlag[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ControlFlag valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getFlags

      public static List<String> getFlags()
      Returns a sorted list of all control flag config names.
      Returns:
      list of flag names
    • parse

      public static long parse(String name)
      Parses a flag name and returns its bitmask value.
      Parameters:
      name - the config name of the flag (case-insensitive)
      Returns:
      the bitmask value, or 0 if not found
    • from

      public static String from(long flag)
      Returns the config name of a flag given its bitmask value.
      Parameters:
      flag - the bitmask value
      Returns:
      the config name, or null if not found
    • getSet

      public static List<String> getSet(long flags)
      Returns a list of flag names that are set (enabled) in the given bitmask.
      Parameters:
      flags - the combined bitmask of flags
      Returns:
      list of enabled flag names
    • getUnset

      public static List<String> getUnset(long flags)
      Returns a list of flag names that are not set (disabled) in the given bitmask.
      Parameters:
      flags - the combined bitmask of flags
      Returns:
      list of disabled flag names
    • getBitmask

      public long getBitmask()
      Returns the bitmask value of this flag.
      Returns:
      the bitmask as a long value
    • getName

      public String getName()
      Returns the configuration name of this flag (lowercase with hyphens).
      Returns:
      the config name