diff --git a/.idea/modules.xml b/.idea/modules.xml index 8915fc5f..bf19ff78 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,7 +2,7 @@ - + \ No newline at end of file diff --git a/src/main/java/me/totalfreedom/totalfreedommod/config/ConfigEntry.java b/src/main/java/me/totalfreedom/totalfreedommod/config/ConfigEntry.java index 19915e89..4a6994a1 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/config/ConfigEntry.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/config/ConfigEntry.java @@ -47,6 +47,7 @@ public enum ConfigEntry SERVER_MOTD(String.class, "server.motd"), SERVER_OWNERS(List.class, "server.owners"), SERVER_EXECUTIVES(List.class, "server.executives"), + SERVER_ASSISTANT_EXECUTIVES(List.class, "server.assistant_executives"), SERVER_MASTER_BUILDER_MANAGEMENT(List.class, "server.master_builder_management"), SERVER_BAN_URL(String.class, "server.ban_url"), SERVER_PERMBAN_URL(String.class, "server.permban_url"), diff --git a/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_list.java b/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_list.java index 2ac03f4c..ee1898a0 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_list.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_list.java @@ -5,7 +5,6 @@ import me.totalfreedom.totalfreedommod.TotalFreedomMod; import me.totalfreedom.totalfreedommod.admin.Admin; import me.totalfreedom.totalfreedommod.config.ConfigEntry; import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD; -import me.totalfreedom.totalfreedommod.util.FLog; import me.totalfreedom.totalfreedommod.util.FUtil; import org.bukkit.Bukkit; import org.bukkit.entity.Player; @@ -34,6 +33,7 @@ public class Module_list extends HTTPDModule final JSONArray telnetadmins = new JSONArray(); final JSONArray senioradmins = new JSONArray(); final JSONArray developers = new JSONArray(); + final JSONArray assistant_executives = new JSONArray(); final JSONArray executives = new JSONArray(); final JSONArray owners = new JSONArray(); @@ -60,6 +60,11 @@ public class Module_list extends HTTPDModule executives.add(player.getName()); } + if (ConfigEntry.SERVER_ASSISTANT_EXECUTIVES.getList().contains(player.getName()) && !FUtil.DEVELOPERS.contains(player.getName())) + { + executives.add(player.getName()); + } + if (ConfigEntry.SERVER_OWNERS.getList().contains(player.getName())) { owners.add(player.getName()); @@ -96,6 +101,7 @@ public class Module_list extends HTTPDModule responseObject.put("telnetadmins", telnetadmins); responseObject.put("senioradmins", senioradmins); responseObject.put("developers", developers); + responseObject.put("assistant_executives", assistant_executives); responseObject.put("executives", executives); responseObject.put("owners", owners); responseObject.put("online", server.getOnlinePlayers().size()); @@ -140,7 +146,7 @@ public class Module_list extends HTTPDModule public boolean hasSpecialTitle(Player player) { - if (FUtil.DEVELOPERS.contains(player.getName()) || ConfigEntry.SERVER_EXECUTIVES.getList().contains(player.getName()) || ConfigEntry.SERVER_OWNERS.getList().contains(player.getName())) + if (FUtil.DEVELOPERS.contains(player.getName()) || ConfigEntry.SERVER_EXECUTIVES.getList().contains(player.getName()) || ConfigEntry.SERVER_ASSISTANT_EXECUTIVES.getList().contains(player.getName()) || ConfigEntry.SERVER_OWNERS.getList().contains(player.getName())) { return true; } diff --git a/src/main/java/me/totalfreedom/totalfreedommod/rank/RankManager.java b/src/main/java/me/totalfreedom/totalfreedommod/rank/RankManager.java index 97ce3fb2..6ddb455a 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/rank/RankManager.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/rank/RankManager.java @@ -67,6 +67,11 @@ public class RankManager extends FreedomService return Title.EXECUTIVE; } + if (ConfigEntry.SERVER_ASSISTANT_EXECUTIVES.getList().contains(player.getName()) && plugin.al.isAdmin(player)) + { + return Title.ASSISTANT_EXECUTIVE; + } + if (plugin.al.isVerifiedAdmin(player)) { return Title.VERIFIED_ADMIN; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/rank/Title.java b/src/main/java/me/totalfreedom/totalfreedommod/rank/Title.java index 978d5bf3..b5fd00f4 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/rank/Title.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/rank/Title.java @@ -8,6 +8,7 @@ public enum Title implements Displayable MASTER_BUILDER("a", "Master Builder", ChatColor.DARK_AQUA, "MB"), VERIFIED_ADMIN("a", "Verified Admin", ChatColor.LIGHT_PURPLE, "VA"), + ASSISTANT_EXECUTIVE("an", "Assistant Executive", ChatColor.RED, "Asst Exec"), EXECUTIVE("an", "Executive", ChatColor.RED, "Exec"), DEVELOPER("a", "Developer", ChatColor.DARK_PURPLE, "Dev"), OWNER("the", "Owner", ChatColor.DARK_RED, "Owner"); diff --git a/src/main/java/me/totalfreedom/totalfreedommod/util/FUtil.java b/src/main/java/me/totalfreedom/totalfreedommod/util/FUtil.java index 372a440e..22834364 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/util/FUtil.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/util/FUtil.java @@ -82,7 +82,7 @@ public class FUtil public static boolean isExecutive(String name) { - return ConfigEntry.SERVER_OWNERS.getStringList().contains(name) || ConfigEntry.SERVER_EXECUTIVES.getStringList().contains(name); + return ConfigEntry.SERVER_OWNERS.getStringList().contains(name) || ConfigEntry.SERVER_EXECUTIVES.getStringList().contains(name) || ConfigEntry.SERVER_ASSISTANT_EXECUTIVES.getStringList().contains(name); } public static boolean isDeveloper(String name) diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index f7d8fc11..f415b389 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -24,6 +24,9 @@ server: # All players who show up as executive executives: [] + # All players who show up as assistant executive + assistant_executives: [] + # All those who can manage the master builder list master_builder_management: []