Enum Class Limit

java.lang.Object
java.lang.Enum<Limit>
me.angeschossen.chestprotect.api.limits.Limit
All Implemented Interfaces:
com.github.angeschossen.pluginframework.api.limit.Limit, Serializable, Comparable<Limit>, Constable

public enum Limit extends Enum<Limit> implements com.github.angeschossen.pluginframework.api.limit.Limit
Protection-related limits that can be configured per player via permissions or the database.
  • Enum Constant Details

    • PLAYER_BLOCKS

      public static final Limit PLAYER_BLOCKS
      Maximum amount of blocks a player can protect.
    • PLAYER_BLOCKS_FREE

      public static final Limit PLAYER_BLOCKS_FREE
      Amount of blocks a player can protect for free.
    • PLAYER_ENTITIES

      public static final Limit PLAYER_ENTITIES
      Amount of entities a player can protect.
    • PLAYER_ENTITIES_FREE

      public static final Limit PLAYER_ENTITIES_FREE
      Amount of entities a player can protect for free.
    • PLAYER_GROUPS

      public static final Limit PLAYER_GROUPS
      Amount of groups a player can create.
    • PROTECTION_MEMBERS

      public static final Limit PROTECTION_MEMBERS
      Amount of members a player can add to a protection or group.
  • Method Details

    • values

      public static Limit[] 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 Limit 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
    • getByPermission

      @Nullable public static @Nullable Limit getByPermission(@NotNull @NotNull String permission)
      Look up a limit by its permission node.
      Parameters:
      permission - the permission node (case-insensitive)
      Returns:
      null, if no limit is associated with this permission
    • hasTarget

      public final boolean hasTarget(@NotNull com.github.angeschossen.pluginframework.api.limit.holder.LimitTarget target)
      Specified by:
      hasTarget in interface com.github.angeschossen.pluginframework.api.limit.Limit
    • getModifierValue

      public int getModifierValue(@NotNull @NotNull com.github.angeschossen.pluginframework.api.limit.holder.LimitHolder limitHolder)
      Specified by:
      getModifierValue in interface com.github.angeschossen.pluginframework.api.limit.Limit
    • registerModifier

      public void registerModifier(@NotNull @NotNull com.github.angeschossen.pluginframework.api.limit.LimitModifier... limitModifiers)
      Specified by:
      registerModifier in interface com.github.angeschossen.pluginframework.api.limit.Limit
    • unregisterModifier

      public void unregisterModifier(@NotNull @NotNull com.github.angeschossen.pluginframework.api.limit.LimitModifier... limitModifiers)
      Specified by:
      unregisterModifier in interface com.github.angeschossen.pluginframework.api.limit.Limit
    • getModifiers

      @NotNull public @NotNull Collection<@NotNull com.github.angeschossen.pluginframework.api.limit.LimitModifier> getModifiers()
      Specified by:
      getModifiers in interface com.github.angeschossen.pluginframework.api.limit.Limit
    • getConfigAliases

      @NotNull public @NotNull Collection<String> getConfigAliases()
      Specified by:
      getConfigAliases in interface com.github.angeschossen.pluginframework.api.limit.Limit
    • getId

      @NotNull public @NotNull String getId()
      Specified by:
      getId in interface com.github.angeschossen.pluginframework.api.limit.Limit
    • getPermission

      @NotNull public @NotNull String getPermission()
      Get the permission node associated with the limit.
      Returns:
      never null