Enum Class Perk

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

public enum Perk extends Enum<Perk>
A limit of Zentrix that a perk tier in perks.yml can raise or lower for the players holding its permission.

A Perk.Type.NUMBER perk is a count, such as how many games a host may have at once. A Perk.Type.TOGGLE perk is allowed or not, such as using the team changer.

Since:
1.9.0
  • Enum Constant Details

    • CUSTOM_GAMES_CREATE

      public static final Perk CUSTOM_GAMES_CREATE
      Whether a player may create and publish custom games. Refusing it never stops them joining custom games, and never cancels the games they already published.
      Since:
      1.10.0
    • CUSTOM_GAMES_MAX_HOSTED

      public static final Perk CUSTOM_GAMES_MAX_HOSTED
      How many scheduled, waiting or running custom games one host may have at once. This limit counts one host's own games; the server-wide publish limit is separate, see CUSTOM_GAMES_BYPASS_PUBLISH_LIMIT.
    • CUSTOM_GAMES_PRIVATE

      public static final Perk CUSTOM_GAMES_PRIVATE
      Whether a host may protect their custom games with a password.
    • CUSTOM_GAMES_SCENARIO_SETTINGS

      public static final Perk CUSTOM_GAMES_SCENARIO_SETTINGS
      Whether a host may change the settings of the scenarios they pick.
    • CUSTOM_GAMES_BYPASS_PUBLISH_LIMIT

      public static final Perk CUSTOM_GAMES_BYPASS_PUBLISH_LIMIT
      Whether a host's publications skip the server-wide publish limit, which caps how many games every host together may publish per interval. Their games still count towards it, and CUSTOM_GAMES_MAX_HOSTED still applies.
    • PARTY_MAX_SIZE

      public static final Perk PARTY_MAX_SIZE
      The largest a party may grow, decided by its current leader.
    • FRIENDS_MAX_FRIENDS

      public static final Perk FRIENDS_MAX_FRIENDS
      How many friends a player may have. Asked as a friend is added, so a player already past a lowered limit keeps their friends.
      Since:
      1.12.0
    • REWARDS_BONUS

      public static final Perk REWARDS_BONUS
      A bonus, in percent, on the currency a player earns from match rewards: 50 pays one and a half times as much. Boosts add to it. Penalties are never raised, and a reward multiplier permission node a player also holds applies instead when it is higher.
      Since:
      1.12.0
    • TEAM_CHANGER

      public static final Perk TEAM_CHANGER
      Whether a player may use the team changer in a waiting lobby.
  • Method Details

    • values

      public static Perk[] 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 Perk 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 key this perk is written under in perks.yml, such as party.max-size.
    • getType

      @NotNull public @NotNull Perk.Type getType()
      What kind of value the perk holds.
    • fromKey

      @NotNull public static @NotNull Optional<Perk> fromKey(@Nullable @Nullable String key)
      The perk a key names: its perks.yml key, or its enum name, ignoring case. Dashes, dots and underscores are interchangeable, so party_max_size names PARTY_MAX_SIZE as well.