diff --git a/multichat/src/main/java/xyz/olivermartin/multichat/bungee/commands/StaffListCommand.java b/multichat/src/main/java/xyz/olivermartin/multichat/bungee/commands/StaffListCommand.java index b0b972b9..c3fc2ea8 100644 --- a/multichat/src/main/java/xyz/olivermartin/multichat/bungee/commands/StaffListCommand.java +++ b/multichat/src/main/java/xyz/olivermartin/multichat/bungee/commands/StaffListCommand.java @@ -2,6 +2,7 @@ import java.util.Iterator; +import de.myzelyam.api.vanish.BungeeVanishAPI; import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.connection.ProxiedPlayer; @@ -9,6 +10,7 @@ import xyz.olivermartin.multichat.bungee.BungeeComm; import xyz.olivermartin.multichat.bungee.ConfigManager; import xyz.olivermartin.multichat.bungee.MessageManager; +import xyz.olivermartin.multichat.bungee.MultiChat; /** * Staff List Command @@ -38,27 +40,39 @@ public void execute(CommandSender sender, String[] args) { server = (String)localIterator1.next(); if (!ProxyServer.getInstance().getServerInfo(server).getPlayers().isEmpty()) { - + onServer = false; for (ProxiedPlayer onlineplayer2 : ProxyServer.getInstance().getPlayers()) { if ((onlineplayer2.hasPermission("multichat.staff"))) { - if (onlineplayer2.getServer().getInfo().getName().equals(server)) { + boolean showInList = true; - if (ConfigManager.getInstance().getHandler("config.yml").getConfig().getBoolean("fetch_spigot_display_names") == true) { - BungeeComm.sendMessage(onlineplayer2.getName(), onlineplayer2.getServer().getInfo()); + if (MultiChat.premiumVanish && MultiChat.hideVanishedStaffInStaffList) { + if (BungeeVanishAPI.isInvisible(onlineplayer2) && !sender.hasPermission("multichat.staff.list.vanished")) { + showInList = false; } + } + + if (showInList) { + + if (onlineplayer2.getServer().getInfo().getName().equals(server)) { + + if (ConfigManager.getInstance().getHandler("config.yml").getConfig().getBoolean("fetch_spigot_display_names") == true) { + BungeeComm.sendMessage(onlineplayer2.getName(), onlineplayer2.getServer().getInfo()); + } + + staff = true; + + if (!onServer) { + MessageManager.sendSpecialMessage(sender, "command_stafflist_list_server", server); + onServer = true; + } + + MessageManager.sendSpecialMessage(sender, "command_stafflist_list_item", onlineplayer2.getDisplayName()); - staff = true; - - if (!onServer) { - MessageManager.sendSpecialMessage(sender, "command_stafflist_list_server", server); - onServer = true; } - - MessageManager.sendSpecialMessage(sender, "command_stafflist_list_item", onlineplayer2.getDisplayName()); } } @@ -66,8 +80,8 @@ public void execute(CommandSender sender, String[] args) { } } - + if (!staff) MessageManager.sendMessage(sender, "command_stafflist_no_staff"); - + } }