public static List<Rank> getDefaultRanks() { List<Rank> results = new ArrayList<>(); for (Rank rank : ranks) { if (rank.isDefaultRank()) { results.add(rank); } } return results; }
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; }
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; }
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; }
public static boolean whitelistBypass(UUID uuid) { for (Rank rank : getRanks(uuid)) { if (rank.getPermissions().contains("cardinal.whitelist.bypass")) return true; } return false; }