mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-01 22:14:49 +00:00
Test commit please ignore
Formatting for everything
This commit is contained in:
1 parent
8a5d531857
commit
f00130f3f7
23 files changed
+1606
-1506
No files matched your search
@@ -35,7 +35,7 @@ import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class CommandHandler implements CommandExecutor
|
||||
public class CommandHandler implements CommandExecutor
|
||||
{
|
||||
private Configuration config = Anticheat.getManager().getConfiguration();
|
||||
private PlayerManager playerManager = Anticheat.getManager().getPlayerManager();
|
||||
@@ -47,44 +47,44 @@ public class CommandHandler implements CommandExecutor
|
||||
private static final ChatColor GRAY = ChatColor.GRAY;
|
||||
private List<String> high = new ArrayList<String>();
|
||||
private List<String> med = new ArrayList<String>();
|
||||
private List<String> low = new ArrayList<String>();
|
||||
private Map<String,Location> spyLocation = new HashMap<String,Location>();
|
||||
private List<String> low = new ArrayList<String>();
|
||||
private Map<String, Location> spyLocation = new HashMap<String, Location>();
|
||||
private static final Server SERVER = Bukkit.getServer();
|
||||
private static final int MED_THRESHOLD = 20;
|
||||
private static final int HIGH_THRESHOLD = 50;
|
||||
private static final String PERMISSIONS_ERROR = RED+"Insufficient Permissions.";
|
||||
|
||||
public void handleLog(CommandSender cs, String [] args)
|
||||
private static final int HIGH_THRESHOLD = 50;
|
||||
private static final String PERMISSIONS_ERROR = RED + "Insufficient Permissions.";
|
||||
|
||||
public void handleLog(CommandSender cs, String[] args)
|
||||
{
|
||||
if(Permission.SYSTEM_LOG.get(cs))
|
||||
if (Permission.SYSTEM_LOG.get(cs))
|
||||
{
|
||||
if(args[1].equalsIgnoreCase("enable"))
|
||||
if (args[1].equalsIgnoreCase("enable"))
|
||||
{
|
||||
if(!config.logConsole())
|
||||
if (!config.logConsole())
|
||||
{
|
||||
config.setLog(true);
|
||||
cs.sendMessage(GREEN+"Console logging enabled.");
|
||||
cs.sendMessage(GREEN + "Console logging enabled.");
|
||||
}
|
||||
else
|
||||
{
|
||||
cs.sendMessage(GREEN+"Console logging is already enabled!");
|
||||
cs.sendMessage(GREEN + "Console logging is already enabled!");
|
||||
}
|
||||
}
|
||||
else if(args[1].equalsIgnoreCase("disable"))
|
||||
else if (args[1].equalsIgnoreCase("disable"))
|
||||
{
|
||||
if(config.logConsole())
|
||||
if (config.logConsole())
|
||||
{
|
||||
config.setLog(false);
|
||||
cs.sendMessage(GREEN+"Console logging disabled.");
|
||||
cs.sendMessage(GREEN + "Console logging disabled.");
|
||||
}
|
||||
else
|
||||
{
|
||||
cs.sendMessage(GREEN+"Console logging is already disabled!");
|
||||
cs.sendMessage(GREEN + "Console logging is already disabled!");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cs.sendMessage(RED+"Usage: /anticheat log [enable/disable]");
|
||||
cs.sendMessage(RED + "Usage: /anticheat log [enable/disable]");
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -92,101 +92,101 @@ public class CommandHandler implements CommandExecutor
|
||||
cs.sendMessage(PERMISSIONS_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
public void handleXRay(CommandSender cs, String [] args)
|
||||
|
||||
public void handleXRay(CommandSender cs, String[] args)
|
||||
{
|
||||
if(Permission.SYSTEM_XRAY.get(cs))
|
||||
if (Permission.SYSTEM_XRAY.get(cs))
|
||||
{
|
||||
if(config.logXRay())
|
||||
if (config.logXRay())
|
||||
{
|
||||
List<Player> list = SERVER.matchPlayer(args[1]);
|
||||
if(list.size() == 1)
|
||||
if (list.size() == 1)
|
||||
{
|
||||
Player player = list.get(0);
|
||||
if(xtracker.sufficientData(player.getName()))
|
||||
if (xtracker.sufficientData(player.getName()))
|
||||
{
|
||||
xtracker.sendStats(cs, player.getName());
|
||||
}
|
||||
else
|
||||
{
|
||||
cs.sendMessage(RED+"Insufficient data collected from "+WHITE+args[1]+RED+".");
|
||||
cs.sendMessage(RED+"Please wait until more info is collected before predictions are calculated.");
|
||||
cs.sendMessage(RED + "Insufficient data collected from " + WHITE + args[1] + RED + ".");
|
||||
cs.sendMessage(RED + "Please wait until more info is collected before predictions are calculated.");
|
||||
}
|
||||
}
|
||||
else if(list.size() > 1)
|
||||
else if (list.size() > 1)
|
||||
{
|
||||
cs.sendMessage(RED+"Multiple players found by name: "+WHITE+args[1]+RED+".");
|
||||
cs.sendMessage(RED + "Multiple players found by name: " + WHITE + args[1] + RED + ".");
|
||||
}
|
||||
else if(xtracker.sufficientData(args[1]))
|
||||
else if (xtracker.sufficientData(args[1]))
|
||||
{
|
||||
xtracker.sendStats(cs, args[1]);
|
||||
xtracker.sendStats(cs, args[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
cs.sendMessage(RED+"Insufficient data collected from "+WHITE+args[1]+RED+".");
|
||||
cs.sendMessage(RED+"Please wait until more info is collected before predictions are calculated.");
|
||||
cs.sendMessage(RED + "Insufficient data collected from " + WHITE + args[1] + RED + ".");
|
||||
cs.sendMessage(RED + "Please wait until more info is collected before predictions are calculated.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cs.sendMessage(RED+"XRay logging is off in the config.");
|
||||
}
|
||||
cs.sendMessage(RED + "XRay logging is off in the config.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cs.sendMessage(PERMISSIONS_ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void handleReset(CommandSender cs, String [] args)
|
||||
|
||||
public void handleReset(CommandSender cs, String[] args)
|
||||
{
|
||||
if(Permission.SYSTEM_RESET.get(cs))
|
||||
if (Permission.SYSTEM_RESET.get(cs))
|
||||
{
|
||||
List<Player> list = SERVER.matchPlayer(args[1]);
|
||||
if(list.size() == 1)
|
||||
if (list.size() == 1)
|
||||
{
|
||||
Player player = list.get(0);
|
||||
if(playerManager.getLevel(player) == 0)
|
||||
if (playerManager.getLevel(player) == 0)
|
||||
{
|
||||
cs.sendMessage(player.getName()+RED+" is already in Low Level!");
|
||||
cs.sendMessage(player.getName() + RED + " is already in Low Level!");
|
||||
}
|
||||
else
|
||||
{
|
||||
playerManager.reset(player);
|
||||
cs.sendMessage(player.getName()+GREEN+" has been reset to Low Level.");
|
||||
cs.sendMessage(player.getName() + GREEN + " has been reset to Low Level.");
|
||||
}
|
||||
xtracker.reset(player.getName());
|
||||
cs.sendMessage(player.getName()+GREEN+"'s XRay stats have been reset.");
|
||||
cs.sendMessage(player.getName() + GREEN + "'s XRay stats have been reset.");
|
||||
}
|
||||
else if(list.size() > 1)
|
||||
else if (list.size() > 1)
|
||||
{
|
||||
cs.sendMessage(RED+"Multiple players found by name: "+WHITE+args[1]+RED+".");
|
||||
cs.sendMessage(RED + "Multiple players found by name: " + WHITE + args[1] + RED + ".");
|
||||
}
|
||||
else
|
||||
{
|
||||
cs.sendMessage(RED+"Player: "+WHITE+args[1]+RED+" not found.");
|
||||
cs.sendMessage(RED + "Player: " + WHITE + args[1] + RED + " not found.");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cs.sendMessage(PERMISSIONS_ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void handleSpy(CommandSender cs, String [] args)
|
||||
|
||||
public void handleSpy(CommandSender cs, String[] args)
|
||||
{
|
||||
if(cs instanceof Player)
|
||||
if (cs instanceof Player)
|
||||
{
|
||||
Player sender = (Player)cs;
|
||||
if(Permission.SYSTEM_SPY.get(cs))
|
||||
Player sender = (Player) cs;
|
||||
if (Permission.SYSTEM_SPY.get(cs))
|
||||
{
|
||||
if(!args[1].equalsIgnoreCase("off"))
|
||||
if (!args[1].equalsIgnoreCase("off"))
|
||||
{
|
||||
List<Player> list = SERVER.matchPlayer(args[1]);
|
||||
if(list.size() == 1)
|
||||
if (list.size() == 1)
|
||||
{
|
||||
Player player = list.get(0);
|
||||
for(Player p : cs.getServer().getOnlinePlayers())
|
||||
for (Player p : cs.getServer().getOnlinePlayers())
|
||||
{
|
||||
p.hidePlayer(sender);
|
||||
}
|
||||
@@ -194,199 +194,199 @@ public class CommandHandler implements CommandExecutor
|
||||
sender.setFlying(true);
|
||||
spyLocation.put(sender.getName(), sender.getLocation());
|
||||
sender.teleport(player);
|
||||
sender.sendMessage(GREEN+"You have been teleported to "+player.getName()+" and made invisible.");
|
||||
sender.sendMessage(GREEN+"To stop spying, type "+WHITE+" /AntiCheat spy off");
|
||||
sender.sendMessage(GREEN + "You have been teleported to " + player.getName() + " and made invisible.");
|
||||
sender.sendMessage(GREEN + "To stop spying, type " + WHITE + " /AntiCheat spy off");
|
||||
}
|
||||
else if(list.size() > 1)
|
||||
else if (list.size() > 1)
|
||||
{
|
||||
cs.sendMessage(RED+"Multiple players found by name: "+WHITE+args[1]+RED+".");
|
||||
cs.sendMessage(RED + "Multiple players found by name: " + WHITE + args[1] + RED + ".");
|
||||
}
|
||||
else
|
||||
{
|
||||
cs.sendMessage(RED+"Player: "+WHITE+args[1]+RED+" not found.");
|
||||
cs.sendMessage(RED + "Player: " + WHITE + args[1] + RED + " not found.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sender.setFlying(false);
|
||||
sender.setAllowFlight(false);
|
||||
if(spyLocation.containsKey(sender.getName()))
|
||||
{
|
||||
sender.setAllowFlight(false);
|
||||
if (spyLocation.containsKey(sender.getName()))
|
||||
{
|
||||
sender.teleport(spyLocation.get(sender.getName()));
|
||||
spyLocation.remove(sender.getName());
|
||||
}
|
||||
for(Player p : cs.getServer().getOnlinePlayers())
|
||||
for (Player p : cs.getServer().getOnlinePlayers())
|
||||
{
|
||||
p.showPlayer(sender);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cs.sendMessage(PERMISSIONS_ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cs.sendMessage(RED+"Sorry, but you can't spy on a player from the console.");
|
||||
}
|
||||
}
|
||||
|
||||
cs.sendMessage(RED + "Sorry, but you can't spy on a player from the console.");
|
||||
}
|
||||
}
|
||||
|
||||
public void handleHelp(CommandSender cs)
|
||||
{
|
||||
if(Permission.SYSTEM_HELP.get(cs))
|
||||
if (Permission.SYSTEM_HELP.get(cs))
|
||||
{
|
||||
String base = "/AntiCheat ";
|
||||
cs.sendMessage("----------------------["+GREEN+"AntiCheat"+WHITE+"]----------------------");
|
||||
cs.sendMessage(base+GREEN+"log [Enable/Disable]"+WHITE+" - toggle logging");
|
||||
cs.sendMessage(base+GREEN+"report"+WHITE+" - get a detailed cheat report");
|
||||
cs.sendMessage(base+GREEN+"report [user]"+WHITE+" - get a player's cheat report");
|
||||
cs.sendMessage(base+GREEN+"reload"+WHITE+" - reload AntiCheat configuration");
|
||||
cs.sendMessage(base+GREEN+"reset [user]"+WHITE+" - reset user's hack level");
|
||||
cs.sendMessage(base+GREEN+"xray [user]"+WHITE+" - check user's xray levels");
|
||||
cs.sendMessage(base+GREEN+"spy [user]"+WHITE+" - spy on a user in secret");
|
||||
cs.sendMessage(base+GREEN+"help"+WHITE+" - access this page");
|
||||
cs.sendMessage(base+GREEN+"update"+WHITE+" - check update status");
|
||||
cs.sendMessage("----------------------[" + GREEN + "AntiCheat" + WHITE + "]----------------------");
|
||||
cs.sendMessage(base + GREEN + "log [Enable/Disable]" + WHITE + " - toggle logging");
|
||||
cs.sendMessage(base + GREEN + "report" + WHITE + " - get a detailed cheat report");
|
||||
cs.sendMessage(base + GREEN + "report [user]" + WHITE + " - get a player's cheat report");
|
||||
cs.sendMessage(base + GREEN + "reload" + WHITE + " - reload AntiCheat configuration");
|
||||
cs.sendMessage(base + GREEN + "reset [user]" + WHITE + " - reset user's hack level");
|
||||
cs.sendMessage(base + GREEN + "xray [user]" + WHITE + " - check user's xray levels");
|
||||
cs.sendMessage(base + GREEN + "spy [user]" + WHITE + " - spy on a user in secret");
|
||||
cs.sendMessage(base + GREEN + "help" + WHITE + " - access this page");
|
||||
cs.sendMessage(base + GREEN + "update" + WHITE + " - check update status");
|
||||
cs.sendMessage("-----------------------------------------------------");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cs.sendMessage(PERMISSIONS_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void handleUpdate(CommandSender cs)
|
||||
{
|
||||
if(Permission.SYSTEM_UPDATE.get(cs))
|
||||
if (Permission.SYSTEM_UPDATE.get(cs))
|
||||
{
|
||||
cs.sendMessage("Running "+GREEN+"AntiCheat "+WHITE+"v"+GREEN+Anticheat.getVersion());
|
||||
cs.sendMessage("Running " + GREEN + "AntiCheat " + WHITE + "v" + GREEN + Anticheat.getVersion());
|
||||
cs.sendMessage("-----------------------------------------------------");
|
||||
if(!Anticheat.isUpdated())
|
||||
if (!Anticheat.isUpdated())
|
||||
{
|
||||
cs.sendMessage(GRAY+"There "+GREEN+"IS"+GRAY+" a newer version avaliable.");
|
||||
if(config.autoUpdate())
|
||||
cs.sendMessage(GRAY + "There " + GREEN + "IS" + GRAY + " a newer version avaliable.");
|
||||
if (config.autoUpdate())
|
||||
{
|
||||
cs.sendMessage(GRAY+"It will be installed automatically for you on next launch.");
|
||||
cs.sendMessage(GRAY + "It will be installed automatically for you on next launch.");
|
||||
}
|
||||
else
|
||||
{
|
||||
cs.sendMessage(GRAY+"Due to your config settings, we "+RED+"can not"+GRAY+" auto update.");
|
||||
cs.sendMessage(GRAY+"Please visit http://dev.bukkit.org/server-mods/anticheat/");
|
||||
cs.sendMessage(GRAY + "Due to your config settings, we " + RED + "can not" + GRAY + " auto update.");
|
||||
cs.sendMessage(GRAY + "Please visit http://dev.bukkit.org/server-mods/anticheat/");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cs.sendMessage(GRAY+"AntiCheat is "+GREEN+"UP TO DATE!");
|
||||
cs.sendMessage(GRAY + "AntiCheat is " + GREEN + "UP TO DATE!");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cs.sendMessage(PERMISSIONS_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void handleReport(CommandSender cs)
|
||||
{
|
||||
if(Permission.SYSTEM_REPORT.get(cs))
|
||||
if (Permission.SYSTEM_REPORT.get(cs))
|
||||
{
|
||||
getPlayers();
|
||||
if(!low.isEmpty())
|
||||
if (!low.isEmpty())
|
||||
{
|
||||
cs.sendMessage(GREEN+"----Level: Low (Not likely hacking)----");
|
||||
for(String string : low)
|
||||
{
|
||||
cs.sendMessage(GREEN+string);
|
||||
}
|
||||
cs.sendMessage(GREEN + "----Level: Low (Not likely hacking)----");
|
||||
for (String string : low)
|
||||
{
|
||||
cs.sendMessage(GREEN + string);
|
||||
}
|
||||
}
|
||||
if(!med.isEmpty())
|
||||
{
|
||||
cs.sendMessage(YELLOW+"----Level: Medium (Possibly hacking/lagging)----");
|
||||
for(String string : med)
|
||||
{
|
||||
cs.sendMessage(YELLOW+string);
|
||||
}
|
||||
if (!med.isEmpty())
|
||||
{
|
||||
cs.sendMessage(YELLOW + "----Level: Medium (Possibly hacking/lagging)----");
|
||||
for (String string : med)
|
||||
{
|
||||
cs.sendMessage(YELLOW + string);
|
||||
}
|
||||
}
|
||||
if(!high.isEmpty())
|
||||
{
|
||||
cs.sendMessage(RED+"----Level: High (Probably hacking or bad connection)----");
|
||||
for(String string : high)
|
||||
{
|
||||
cs.sendMessage(RED+string);
|
||||
}
|
||||
if (!high.isEmpty())
|
||||
{
|
||||
cs.sendMessage(RED + "----Level: High (Probably hacking or bad connection)----");
|
||||
for (String string : high)
|
||||
{
|
||||
cs.sendMessage(RED + string);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cs.sendMessage(PERMISSIONS_ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void handlePlayerReport(CommandSender cs,String [] args)
|
||||
|
||||
public void handlePlayerReport(CommandSender cs, String[] args)
|
||||
{
|
||||
if(Permission.SYSTEM_REPORT.get(cs))
|
||||
if (Permission.SYSTEM_REPORT.get(cs))
|
||||
{
|
||||
List<Player> list = SERVER.matchPlayer(args[1]);
|
||||
if(list.size() == 1)
|
||||
if (list.size() == 1)
|
||||
{
|
||||
Player player = list.get(0);
|
||||
if(args.length == 2)
|
||||
if (args.length == 2)
|
||||
{
|
||||
sendPlayerReport(cs,CheckType.values(),player,1);
|
||||
sendPlayerReport(cs, CheckType.values(), player, 1);
|
||||
}
|
||||
else if(Utilities.isInt(args[2]))
|
||||
else if (Utilities.isInt(args[2]))
|
||||
{
|
||||
int num = Integer.parseInt(args[2]);
|
||||
if(num <= 3 && num > 1)
|
||||
if (num <= 3 && num > 1)
|
||||
{
|
||||
sendPlayerReport(cs,CheckType.values(),player,num);
|
||||
sendPlayerReport(cs, CheckType.values(), player, num);
|
||||
}
|
||||
else
|
||||
{
|
||||
cs.sendMessage(RED+"Page: "+num+RED+" does not exist.");
|
||||
cs.sendMessage(RED + "Page: " + num + RED + " does not exist.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cs.sendMessage(RED+"Not a valid page number: "+WHITE+args[2]);
|
||||
cs.sendMessage(RED + "Not a valid page number: " + WHITE + args[2]);
|
||||
}
|
||||
}
|
||||
else if(list.size() > 1)
|
||||
else if (list.size() > 1)
|
||||
{
|
||||
cs.sendMessage(RED+"Multiple players found by name: "+WHITE+args[1]+RED+".");
|
||||
cs.sendMessage(RED + "Multiple players found by name: " + WHITE + args[1] + RED + ".");
|
||||
}
|
||||
else
|
||||
{
|
||||
cs.sendMessage(RED+"Player: "+WHITE+args[1]+RED+" not found.");
|
||||
}
|
||||
}
|
||||
cs.sendMessage(RED + "Player: " + WHITE + args[1] + RED + " not found.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cs.sendMessage(PERMISSIONS_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void sendPlayerReport(CommandSender cs, CheckType[] types, Player player, int page)
|
||||
{
|
||||
cs.sendMessage("--------------------["+GREEN+"REPORT["+page+"/3]"+WHITE+"]---------------------");
|
||||
if(page == 1)
|
||||
cs.sendMessage("--------------------[" + GREEN + "REPORT[" + page + "/3]" + WHITE + "]---------------------");
|
||||
if (page == 1)
|
||||
{
|
||||
int level = playerManager.getLevel(player);
|
||||
String levelString = GREEN+"Low";
|
||||
if(level >= 20)
|
||||
String levelString = GREEN + "Low";
|
||||
if (level >= 20)
|
||||
{
|
||||
levelString = YELLOW+"Medium";
|
||||
levelString = YELLOW + "Medium";
|
||||
}
|
||||
else if (level >= 50)
|
||||
{
|
||||
levelString = RED+"High";
|
||||
levelString = RED + "High";
|
||||
}
|
||||
cs.sendMessage(GRAY+"Player: "+WHITE+player.getName());
|
||||
cs.sendMessage(GRAY+"Level: "+levelString);
|
||||
for(int i=0;i<6;i++)
|
||||
cs.sendMessage(GRAY + "Player: " + WHITE + player.getName());
|
||||
cs.sendMessage(GRAY + "Level: " + levelString);
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
int use = types[i].getUses(player);
|
||||
ChatColor color = WHITE;
|
||||
if(use >= 20)
|
||||
if (use >= 20)
|
||||
{
|
||||
color = YELLOW;
|
||||
}
|
||||
@@ -394,16 +394,16 @@ public class CommandHandler implements CommandExecutor
|
||||
{
|
||||
color = RED;
|
||||
}
|
||||
cs.sendMessage(GRAY+CheckType.getName(types[i])+": "+color+use);
|
||||
}
|
||||
cs.sendMessage(GRAY + CheckType.getName(types[i]) + ": " + color + use);
|
||||
}
|
||||
}
|
||||
else if(page == 2)
|
||||
else if (page == 2)
|
||||
{
|
||||
for(int i=6;i<14;i++)
|
||||
for (int i = 6; i < 14; i++)
|
||||
{
|
||||
int use = types[i].getUses(player);
|
||||
ChatColor color = WHITE;
|
||||
if(use >= 20)
|
||||
if (use >= 20)
|
||||
{
|
||||
color = YELLOW;
|
||||
}
|
||||
@@ -411,16 +411,16 @@ public class CommandHandler implements CommandExecutor
|
||||
{
|
||||
color = RED;
|
||||
}
|
||||
cs.sendMessage(GRAY+CheckType.getName(types[i])+": "+color+use);
|
||||
}
|
||||
cs.sendMessage(GRAY + CheckType.getName(types[i]) + ": " + color + use);
|
||||
}
|
||||
}
|
||||
else if(page == 3)
|
||||
else if (page == 3)
|
||||
{
|
||||
for(int i=14;i<21;i++)
|
||||
for (int i = 14; i < 21; i++)
|
||||
{
|
||||
int use = types[i].getUses(player);
|
||||
ChatColor color = WHITE;
|
||||
if(use >= 20)
|
||||
if (use >= 20)
|
||||
{
|
||||
color = YELLOW;
|
||||
}
|
||||
@@ -428,106 +428,106 @@ public class CommandHandler implements CommandExecutor
|
||||
{
|
||||
color = RED;
|
||||
}
|
||||
cs.sendMessage(GRAY+CheckType.getName(types[i])+": "+color+use);
|
||||
}
|
||||
}
|
||||
cs.sendMessage("-----------------------------------------------------");
|
||||
|
||||
cs.sendMessage(GRAY + CheckType.getName(types[i]) + ": " + color + use);
|
||||
}
|
||||
}
|
||||
cs.sendMessage("-----------------------------------------------------");
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void handleReload(CommandSender cs)
|
||||
{
|
||||
if(Permission.SYSTEM_RELOAD.get(cs))
|
||||
if (Permission.SYSTEM_RELOAD.get(cs))
|
||||
{
|
||||
config.load();
|
||||
cs.sendMessage(GREEN+"AntiCheat configuration reloaded.");
|
||||
}
|
||||
cs.sendMessage(GREEN + "AntiCheat configuration reloaded.");
|
||||
}
|
||||
else
|
||||
{
|
||||
cs.sendMessage(PERMISSIONS_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender cs, Command cmd, String alias, String[] args)
|
||||
{
|
||||
if(args.length == 3)
|
||||
{
|
||||
if(args[0].equalsIgnoreCase("report"))
|
||||
{
|
||||
handlePlayerReport(cs,args);
|
||||
}
|
||||
}
|
||||
else if(args.length == 2)
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender cs, Command cmd, String alias, String[] args)
|
||||
{
|
||||
if (args.length == 3)
|
||||
{
|
||||
if(args[0].equalsIgnoreCase("log"))
|
||||
if (args[0].equalsIgnoreCase("report"))
|
||||
{
|
||||
handleLog(cs,args);
|
||||
handlePlayerReport(cs, args);
|
||||
}
|
||||
else if(args[0].equalsIgnoreCase("xray"))
|
||||
{
|
||||
handleXRay(cs,args);
|
||||
}
|
||||
else if (args.length == 2)
|
||||
{
|
||||
if (args[0].equalsIgnoreCase("log"))
|
||||
{
|
||||
handleLog(cs, args);
|
||||
}
|
||||
else if (args[0].equalsIgnoreCase("xray"))
|
||||
{
|
||||
handleXRay(cs, args);
|
||||
}
|
||||
else if (args[0].equalsIgnoreCase("reset"))
|
||||
{
|
||||
handleReset(cs, args);
|
||||
}
|
||||
else if (args[0].equalsIgnoreCase("spy"))
|
||||
{
|
||||
handleSpy(cs, args);
|
||||
}
|
||||
else if (args[0].equalsIgnoreCase("report"))
|
||||
{
|
||||
handlePlayerReport(cs, args);
|
||||
}
|
||||
else if(args[0].equalsIgnoreCase("reset"))
|
||||
{
|
||||
handleReset(cs,args);
|
||||
}
|
||||
else if(args[0].equalsIgnoreCase("spy"))
|
||||
{
|
||||
handleSpy(cs,args);
|
||||
}
|
||||
else if(args[0].equalsIgnoreCase("report"))
|
||||
{
|
||||
handlePlayerReport(cs,args);
|
||||
}
|
||||
else
|
||||
{
|
||||
cs.sendMessage(RED+"Unrecognized command.");
|
||||
}
|
||||
cs.sendMessage(RED + "Unrecognized command.");
|
||||
}
|
||||
}
|
||||
else if (args.length == 1)
|
||||
{
|
||||
if(args[0].equalsIgnoreCase("help"))
|
||||
{
|
||||
if (args[0].equalsIgnoreCase("help"))
|
||||
{
|
||||
handleHelp(cs);
|
||||
}
|
||||
else if(args[0].equalsIgnoreCase("report"))
|
||||
}
|
||||
else if (args[0].equalsIgnoreCase("report"))
|
||||
{
|
||||
handleReport(cs);
|
||||
}
|
||||
else if(args[0].equalsIgnoreCase("reload"))
|
||||
else if (args[0].equalsIgnoreCase("reload"))
|
||||
{
|
||||
handleReload(cs);
|
||||
}
|
||||
else if(args[0].equalsIgnoreCase("update"))
|
||||
}
|
||||
else if (args[0].equalsIgnoreCase("update"))
|
||||
{
|
||||
handleUpdate(cs);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cs.sendMessage(RED+"Unrecognized command.");
|
||||
}
|
||||
cs.sendMessage(RED + "Unrecognized command.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cs.sendMessage(RED+"Unrecognized command. Try "+ChatColor.WHITE+"/anticheat help");
|
||||
}
|
||||
cs.sendMessage(RED + "Unrecognized command. Try " + ChatColor.WHITE + "/anticheat help");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public void getPlayers()
|
||||
{
|
||||
high.clear();
|
||||
med.clear();
|
||||
low.clear();
|
||||
for(Player player : SERVER.getOnlinePlayers())
|
||||
for (Player player : SERVER.getOnlinePlayers())
|
||||
{
|
||||
int level = playerManager.getLevel(player);
|
||||
if(level <= MED_THRESHOLD)
|
||||
if (level <= MED_THRESHOLD)
|
||||
{
|
||||
low.add(player.getName());
|
||||
}
|
||||
else if(level <= HIGH_THRESHOLD)
|
||||
else if (level <= HIGH_THRESHOLD)
|
||||
{
|
||||
med.add(player.getName());
|
||||
}
|
||||
@@ -535,6 +535,6 @@ public class CommandHandler implements CommandExecutor
|
||||
{
|
||||
high.add(player.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user