Enum Class PerkResolutionMode

java.lang.Object
java.lang.Enum<PerkResolutionMode>
dev.itsharshxd.zentrix.api.perk.PerkResolutionMode
All Implemented Interfaces:
Serializable, Comparable<PerkResolutionMode>, Constable

public enum PerkResolutionMode extends Enum<PerkResolutionMode>
How a player holding several tiers gets each perk, set by resolution-mode in perks.yml. Either way, the tier a player is shown as belonging to is the highest-priority one they hold.
Since:
1.16.0
  • Enum Constant Details

    • HIGHEST_PRIORITY

      public static final PerkResolutionMode HIGHEST_PRIORITY
      Every perk comes from the highest-priority tier the player holds.
    • BEST_VALUE

      public static final PerkResolutionMode BEST_VALUE
      Each perk takes the best value across every tier the player holds: the highest number, unlimited above all, and a toggle any of them allows.
  • Method Details

    • values

      public static PerkResolutionMode[] 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 PerkResolutionMode 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
    • getKey

      @NotNull public @NotNull String getKey()
      The value written in perks.yml, such as best-value.
    • fromKey

      @NotNull public static @NotNull Optional<PerkResolutionMode> fromKey(@Nullable @Nullable String key)
      The mode a perks.yml value names, ignoring case, dashes and underscores.