Exemple #1
0
 public static List<Rank> getDefaultRanks() {
   List<Rank> results = new ArrayList<>();
   for (Rank rank : ranks) {
     if (rank.isDefaultRank()) {
       results.add(rank);
     }
   }
   return results;
 }
Exemple #2
0
 public static List<Rank> getRanks(UUID uuid) {
   List<Rank> ranks = new ArrayList<>();
   for (Rank rank : Rank.ranks) {
     if (rank.contains(uuid)) {
       ranks.add(rank);
     }
   }
   return ranks;
 }
Exemple #3
0
 public static Rank getRank(String name) {
   for (Rank rank : ranks) {
     if (rank.getName().equalsIgnoreCase(name)) {
       return rank;
     }
   }
   for (Rank rank : ranks) {
     if (rank.getName().toLowerCase().startsWith(name.toLowerCase())) {
       return rank;
     }
   }
   return null;
 }
Exemple #4
0
 public static String getPrefix(UUID uuid) {
   String prefix = "";
   String staffChar = "\u2756";
   if (Bukkit.getOfflinePlayer(uuid).isOp()) {
     prefix += ChatColor.GOLD + staffChar;
   }
   if (PermissionModule.isDeveloper(uuid)) {
     prefix += ChatColor.DARK_PURPLE + staffChar;
   }
   for (Rank rank : getRanks(uuid)) {
     if (!rank.staffRank) continue;
     if (rank.contains(uuid)) {
       prefix += rank.getFlair();
     }
   }
   if (isMapAuthor(uuid)) {
     prefix += ChatColor.BLUE + "*";
   }
   for (Rank rank : getRanks(uuid)) {
     if (rank.staffRank) continue;
     if (rank.contains(uuid)) {
       prefix += rank.getFlair();
     }
   }
   return prefix;
 }
Exemple #5
0
 public static boolean whitelistBypass(UUID uuid) {
   for (Rank rank : getRanks(uuid)) {
     if (rank.getPermissions().contains("cardinal.whitelist.bypass")) return true;
   }
   return false;
 }