Enum Class ActivationStrategy

java.lang.Object
java.lang.Enum<ActivationStrategy>
wtf.choco.veinminer.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.
  • Enum Constant Details

    • NONE

      public static final ActivationStrategy NONE
      Never activated. Disabled.
    • CLIENT

      public static final ActivationStrategy CLIENT
      Activated by the client with a client-sided mod.
    • SNEAK

      public static final ActivationStrategy SNEAK
      Activated when a player is holding sneak.
    • STAND

      public static final ActivationStrategy STAND
      Activated when a player is standing up (i.e. not sneaking).
    • ALWAYS

      public static final ActivationStrategy ALWAYS
      Always activated.
  • Method Details

    • values

      public static ActivationStrategy[] 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 ActivationStrategy 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
    • getFriendlyName

      @NotNull public @NotNull String 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

      public boolean test(VeinMinerPlayer player)
      Check whether or not the given player has activated this strategy.
      Specified by:
      test in interface Predicate<VeinMinerPlayer>
      Parameters:
      player - the player to check
      Returns:
      true if active, false otherwise
    • isActive

      public boolean isActive(@NotNull @NotNull VeinMinerPlayer player)
      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