From e0bbbbdda89451ef0cbe338a68eb557a31a5f1ba Mon Sep 17 00:00:00 2001 From: ZeroEpoch1969 <13510767+ZeroEpoch1969@users.noreply.github.com> Date: Sun, 24 Nov 2019 11:56:32 -0700 Subject: [PATCH] assistant executive title now exists --- .idea/modules.xml | 2 +- .../totalfreedommod/config/ConfigEntry.java | 1 + .../totalfreedommod/httpd/module/Module_list.java | 10 ++++++++-- .../totalfreedom/totalfreedommod/rank/RankManager.java | 5 +++++ .../me/totalfreedom/totalfreedommod/rank/Title.java | 1 + .../me/totalfreedom/totalfreedommod/util/FUtil.java | 2 +- src/main/resources/config.yml | 3 +++ 7 files changed, 20 insertions(+), 4 deletions(-) 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: []