Class Rank

All Implemented Interfaces:
Cloneable, Comparable<Rank>

public class Rank extends KingdomsObject<String> implements Comparable<Rank>, Cloneable
  • Field Details

    • CUSTOM_RANKS

      public static boolean CUSTOM_RANKS
  • Constructor Details

  • Method Details

    • copyDefaults

      public static RankMap copyDefaults()
    • init

      public static void init()
    • getDefaultRanks

      public static RankMap getDefaultRanks()
    • determineNextKing

      public static @Nullable KingdomPlayer determineNextKing(@NonNull ArrayList<KingdomPlayer> members, @Nullable Comparator<KingdomPlayer> comparator)
    • getHighestRank

      public static Rank getHighestRank()
    • getLowestRank

      public static @NonNull Rank getLowestRank()
    • copyPermissions

      public Set<KingdomPermission> copyPermissions()
    • hasPermission

      public boolean hasPermission(KingdomPermission permission)
    • clone

      public @NonNull Rank clone()
      Overrides:
      clone in class Object
    • compareTo

      public int compareTo(@NonNull Rank rank)
      Specified by:
      compareTo in interface Comparable<Rank>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getDataKey

      public @NonNull String getDataKey()
      Specified by:
      getDataKey in class KingdomsObject<String>
    • getCompressedData

      public @NonNull String getCompressedData()
      Specified by:
      getCompressedData in class KingdomsObject<String>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toShortString

      public String toShortString()
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • isHigherThan

      public boolean isHigherThan(@NonNull Rank rank)
      Checks whether this rank has higher priority than the given rank.
      See Also:
    • isKing

      public boolean isKing()
    • getNode

      public @NonNull String getNode()
    • setNode

      protected void setNode(@NonNull String node)
    • canBePromoted

      public boolean canBePromoted()
      Whether this rank can be promoted. The king rank and a rank below the king rank ("general" by default) cannot be "promoted" the general must simply be "set" as king.
    • getMaterial

      public @NonNull com.cryptomorin.xseries.XMaterial getMaterial()
    • setMaterial

      public void setMaterial(com.cryptomorin.xseries.XMaterial material)
    • getName

      public @Nullable String getName()
    • setName

      public void setName(@Nullable String name)
    • getColor

      public @Nullable String getColor()
    • setColor

      public void setColor(@Nullable String color)
    • getSymbol

      public @Nullable String getSymbol()
    • setSymbol

      public void setSymbol(@Nullable String symbol)
    • getMaxClaims

      public int getMaxClaims()
    • setMaxClaims

      public void setMaxClaims(int maxClaims)
    • getPriority

      public @org.checkerframework.common.value.qual.IntRange(from=0L, to=2147483647L) int getPriority()
      Rank priorities start from zero. King has priority 0 This means that "less important" ranks have higher priority.
      See Also:
    • setPriority

      @Internal protected void setPriority(@org.checkerframework.common.value.qual.IntRange(from=0L, to=2147483647L) int priority)
    • getPermissions

      public @NonNull Set<KingdomPermission> getPermissions()
    • setPermissions

      public void setPermissions(@NonNull Set<KingdomPermission> permissions)