Package wtf.choco.veinminer
Enum Class ActivationStrategy
- All Implemented Interfaces:
Serializable
,Comparable<ActivationStrategy>
,Constable
,Predicate<VeinMinerPlayer>
public enum ActivationStrategy
extends Enum<ActivationStrategy>
implements Predicate<VeinMinerPlayer>
Represents the different methods of activating vein miner.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescription@NotNull String
Get the friendly name for this activation strategy.boolean
isActive
(@NotNull VeinMinerPlayer player) Check whether or not the given player has activated this strategy.boolean
test
(VeinMinerPlayer player) Check whether or not the given player has activated this strategy.static ActivationStrategy
Returns the enum constant of this class with the specified name.static ActivationStrategy[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NONE
Never activated. Disabled. -
CLIENT
Activated by the client with a client-sided mod. -
SNEAK
Activated when a player is holding sneak. -
STAND
Activated when a player is standing up (i.e. not sneaking). -
ALWAYS
Always activated.
-
-
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
-
getFriendlyName
Get the friendly name for this activation strategy. In most cases, this is just the name of the enum with more appropriate capitalization.- Returns:
- the friendly name
-
test
Check whether or not the given player has activated this strategy.- Specified by:
test
in interfacePredicate<VeinMinerPlayer>
- Parameters:
player
- the player to check- Returns:
- true if active, false otherwise
-
isActive
Check whether or not the given player has activated this strategy.This method exists purely for the sake of clarity and simply delegates to
test(VeinMinerPlayer)
.- Parameters:
player
- the player to check- Returns:
- true if active, false otherwise
-