Enum Class Limit
- All Implemented Interfaces:
Serializable, Comparable<Limit>, Constable
Represents a limit that can be set for a player.
Each limit has a user permission and an admin permission. The user permission is used to determine the limit for a player by checking the highest numerical suffix of the permission node. The admin permission is used to bypass the limit altogether.
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe maximum distance a structure can move measured in blocks.The maximum distance a power block can be from a structure.The maximum number of structures a player can own.The maximum size a structure can have in number of blocks. -
Method Summary
Modifier and TypeMethodDescriptionThe permission node for an admin to bypass the limit.getGlobalLimit(IConfig config) Gets the global limit for this limit.The permission node for the user to determine the limit.static LimitReturns the enum constant of this class with the specified name.static Limit[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
STRUCTURE_SIZE
The maximum size a structure can have in number of blocks. -
STRUCTURE_COUNT
The maximum number of structures a player can own. -
POWERBLOCK_DISTANCE
The maximum distance a power block can be from a structure. -
BLOCKS_TO_MOVE
The maximum distance a structure can move measured in blocks.This does not take the number of blocks the structure actually moves into account, only the distance the structure moves.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
getGlobalLimit
Gets the global limit for this limit.- Parameters:
config- The config to get the global limit from.- Returns:
- The global limit for this limit as defined in the config.
-
getUserPermission
The permission node for the user to determine the limit.The limit for a player is determined by checking the highest numerical suffix of this permission node.
- Returns:
- The permission node for the user to determine the limit.
-
getAdminPermission
The permission node for an admin to bypass the limit.- Returns:
- The permission node for an admin to bypass the limit.
-