From 6b3a765c90c240fe2a509079c48180ef2147eddd Mon Sep 17 00:00:00 2001 From: Telesphoreo Date: Mon, 17 Aug 2020 21:21:13 -0500 Subject: [PATCH] shorten Administrator --- .../me/totalfreedom/totalfreedommod/rank/Rank.java | 2 +- .../totalfreedommod/staff/StaffList.java | 12 ++++++++++++ .../me/totalfreedom/totalfreedommod/util/FUtil.java | 3 ++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/totalfreedom/totalfreedommod/rank/Rank.java b/src/main/java/me/totalfreedom/totalfreedommod/rank/Rank.java index 93b14d6e..84418885 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/rank/Rank.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/rank/Rank.java @@ -10,7 +10,7 @@ public enum Rank implements Displayable OP("an", "Operator", Type.PLAYER, "OP", ChatColor.GREEN, null, false), TRIAL_MOD("a", "Trial Moderator", Type.STAFF, "Trial Mod", ChatColor.AQUA, org.bukkit.ChatColor.AQUA, true), MOD("a", "Moderator", Type.STAFF, "Mod", ChatColor.DARK_GREEN, org.bukkit.ChatColor.DARK_GREEN, true), - ADMIN("an", "Administrator", Type.STAFF, "Administrator", ChatColor.GOLD, org.bukkit.ChatColor.GOLD, true), + ADMIN("an", "Administrator", Type.STAFF, "Admin", ChatColor.GOLD, org.bukkit.ChatColor.GOLD, true), MOD_CONSOLE("the", "Console", Type.STAFF_CONSOLE, "Console", ChatColor.DARK_PURPLE, null, false), ADMIN_CONSOLE("the", "Console", Type.STAFF_CONSOLE, "Console", ChatColor.DARK_PURPLE, null, false); @Getter diff --git a/src/main/java/me/totalfreedom/totalfreedommod/staff/StaffList.java b/src/main/java/me/totalfreedom/totalfreedommod/staff/StaffList.java index 261ad3c2..2aa4bfcb 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/staff/StaffList.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/staff/StaffList.java @@ -106,6 +106,18 @@ public class StaffList extends FreedomService return staffMember != null && staffMember.isActive(); } + public boolean isStaff(Player player) + { + if (player == null) + { + return true; + } + + StaffMember staffMember = getAdmin(player); + + return staffMember != null && staffMember.isActive(); + } + public boolean isMod(CommandSender sender) { StaffMember staffMember = getAdmin(sender); diff --git a/src/main/java/me/totalfreedom/totalfreedommod/util/FUtil.java b/src/main/java/me/totalfreedom/totalfreedommod/util/FUtil.java index c15912a3..0197fe5b 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/util/FUtil.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/util/FUtil.java @@ -47,6 +47,7 @@ import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.scheduler.BukkitTask; import org.json.simple.JSONArray; +import static org.bukkit.Bukkit.getServer; public class FUtil { @@ -627,7 +628,7 @@ public class FUtil public static String getNMSVersion() { - String packageName = Bukkit.getServer().getClass().getPackage().getName(); + String packageName = getServer().getClass().getPackage().getName(); return packageName.substring(packageName.lastIndexOf('.') + 1); }