Change AntiBot from static to instance

- Convert static methods in AntiBot
- Create BukkitService for operations requiring calls to static methods on the Bukkit class
This commit is contained in:
ljacqu
2016-03-24 20:58:18 +01:00
parent 881a192413
commit 351b24fd14
8 changed files with 161 additions and 107 deletions
@@ -18,8 +18,9 @@ public class SwitchAntiBotCommand implements ExecutableCommand {
@Override
public void executeCommand(final CommandSender sender, List<String> arguments, CommandService commandService) {
AntiBot antiBot = commandService.getAntiBot();
if (arguments.isEmpty()) {
sender.sendMessage("[AuthMe] AntiBot status: " + AntiBot.getAntiBotStatus().name());
sender.sendMessage("[AuthMe] AntiBot status: " + antiBot.getAntiBotStatus().name());
return;
}
@@ -27,10 +28,10 @@ public class SwitchAntiBotCommand implements ExecutableCommand {
// Enable or disable the mod
if ("ON".equalsIgnoreCase(newState)) {
AntiBot.overrideAntiBotStatus(true);
antiBot.overrideAntiBotStatus(true);
sender.sendMessage("[AuthMe] AntiBot Manual Override: enabled!");
} else if ("OFF".equalsIgnoreCase(newState)) {
AntiBot.overrideAntiBotStatus(false);
antiBot.overrideAntiBotStatus(false);
sender.sendMessage("[AuthMe] AntiBot Manual Override: disabled!");
} else {
sender.sendMessage(ChatColor.DARK_RED + "Invalid AntiBot mode!");