Package com.xyrisdev.cloud.kits.model
Enum Class KitRule
- All Implemented Interfaces:
Serializable
,Comparable<KitRule>
,Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionIf enabled, the first player to reach 100 hits wins.If enabled, players will be able to break blocks.If enabled, players will be able to place blocks.If enabled, players will not be able to craft items.If enabled, players will not take damage.If enabled, the shot arrows will despawn automatically.If enabled, players will not take fall damage.If enabled, players will not regenerate health.If enabled, players will not lose hunger.If enabled, players will be able to break blocks placed by them and their opponent.If enabled, the player to touch water loses. -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Checks if a specific rule is enabled for a given kit.static @Nullable KitRule
fromString
(@NotNull String rule) Converts a string representation of a rule to the correspondingKitRule
enum.static KitRule
Returns the enum constant of this class with the specified name.static KitRule[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
HUNGER
If enabled, players will not lose hunger. Default: false (Players will lose hunger). -
BUILD
If enabled, players will be able to place blocks. Default: false (Players will not be able to place blocks). -
BREAK
If enabled, players will be able to break blocks. Default: false (Players will not be able to break blocks). -
PLAYER_PLACED_BLOCK_BREAK
-
FALL_DAMAGE
If enabled, players will not take fall damage. Default: false (Players will take fall damage). -
DAMAGE
If enabled, players will not take damage. Default: false (Players will take damage). -
HEALTH_REGENERATION
If enabled, players will not regenerate health. Default: false (Players will regenerate health). -
CRAFTING
If enabled, players will not be able to craft items. Default: false (Players will be able to craft items). -
DESPAWN_ARROWS
If enabled, the shot arrows will despawn automatically. Default: false (Shot arrows will not despawn automatically). -
BOXING
If enabled, the first player to reach 100 hits wins. Default: false (The hit-based victory condition is not enabled). -
SUMO
If enabled, the player to touch water loses. Default: false (Touching water does not result in a loss).
-
-
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
-
enabled
Checks if a specific rule is enabled for a given kit.- Parameters:
rule
- The rule to check.kit
- The kit name.- Returns:
true
if the rule is enabled for the given kit, otherwisefalse
.
-
fromString
Converts a string representation of a rule to the correspondingKitRule
enum.- Parameters:
rule
- The string representation of the rule.- Returns:
- The corresponding
KitRule
if valid, otherwisenull
.
-