Skip to content

Commit

Permalink
Attempted to add premium vanish support in staff list
Browse files Browse the repository at this point in the history
  • Loading branch information
OllieMartin committed May 10, 2020
1 parent d726c17 commit 6b72ced
Showing 1 changed file with 27 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

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;
import net.md_5.bungee.api.plugin.Command;
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
Expand Down Expand Up @@ -38,36 +40,48 @@ 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());

}
}
}

}
}

if (!staff) MessageManager.sendMessage(sender, "command_stafflist_no_staff");

}
}

0 comments on commit 6b72ced

Please sign in to comment.