diff --git a/src/main/java/net/gravitydevelopment/anticheat/api/AntiCheatAPI.java b/src/main/java/net/gravitydevelopment/anticheat/api/AntiCheatAPI.java index 45f33f6..f96e4f6 100644 --- a/src/main/java/net/gravitydevelopment/anticheat/api/AntiCheatAPI.java +++ b/src/main/java/net/gravitydevelopment/anticheat/api/AntiCheatAPI.java @@ -44,8 +44,8 @@ public class AntiCheatAPI { * * @param type Check to start watching for */ - public static void activateCheck(CheckType type) { - chk.activateCheck(type, getCallingClass()); + public static void activateCheck(CheckType type, Class caller) { + chk.activateCheck(type, caller.getName()); } /** @@ -53,8 +53,8 @@ public class AntiCheatAPI { * * @param type Check to stop watching for */ - public static void deactivateCheck(CheckType type) { - chk.deactivateCheck(type, getCallingClass()); + public static void deactivateCheck(CheckType type, Class caller) { + chk.deactivateCheck(type, caller.getName()); } /** @@ -73,8 +73,8 @@ public class AntiCheatAPI { * @param player Player to stop watching * @param type Check to stop watching for */ - public static void exemptPlayer(Player player, CheckType type) { - chk.exemptPlayer(player, type, getCallingClass()); + public static void exemptPlayer(Player player, CheckType type, Class caller) { + chk.exemptPlayer(player, type, caller.getName()); } /** @@ -83,8 +83,8 @@ public class AntiCheatAPI { * @param player Player to start watching * @param type Check to start watching for */ - public static void unexemptPlayer(Player player, CheckType type) { - chk.unexemptPlayer(player, type, getCallingClass()); + public static void unexemptPlayer(Player player, CheckType type, Class caller) { + chk.unexemptPlayer(player, type, caller.getName()); } /** @@ -176,7 +176,5 @@ public class AntiCheatAPI { return AntiCheat.getManager(); } - private static String getCallingClass() { - return sun.reflect.Reflection.getCallerClass(2).getName(); - } + } diff --git a/src/main/java/net/gravitydevelopment/anticheat/command/CommandHandler.java b/src/main/java/net/gravitydevelopment/anticheat/command/CommandHandler.java index e3a699a..a239326 100644 --- a/src/main/java/net/gravitydevelopment/anticheat/command/CommandHandler.java +++ b/src/main/java/net/gravitydevelopment/anticheat/command/CommandHandler.java @@ -42,7 +42,6 @@ public class CommandHandler implements CommandExecutor { public CommandHandler() { commands.add(new CommandHelp()); - //commands.add(new CommandCalibrate()); commands.add(new CommandCheck()); commands.add(new CommandDebug()); commands.add(new CommandDeveloper()); diff --git a/src/main/java/net/gravitydevelopment/anticheat/command/executors/CommandCalibrate.java b/src/main/java/net/gravitydevelopment/anticheat/command/executors/CommandCalibrate.java deleted file mode 100644 index 6591729..0000000 --- a/src/main/java/net/gravitydevelopment/anticheat/command/executors/CommandCalibrate.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * AntiCheat for Bukkit. - * Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package net.gravitydevelopment.anticheat.command.executors; - -import net.gravitydevelopment.anticheat.AntiCheat; -import net.gravitydevelopment.anticheat.command.CommandBase; -import net.gravitydevelopment.anticheat.util.Calibrator; -import net.gravitydevelopment.anticheat.util.Permission; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -public class CommandCalibrate extends CommandBase { - - private static final String NAME = "AntiCheat Calibration"; - private static final String COMMAND = "calibrate"; - private static final String USAGE = "anticheat calibrate"; - private static final Permission PERMISSION = Permission.SYSTEM_CALIBRATE; - private static final String[] HELP = { - GRAY + "Use: " + AQUA + "/anticheat calibrate" + GRAY + " to calibrate AntiCheat settings", - }; - - public CommandCalibrate() { - super(NAME, COMMAND, USAGE, HELP, PERMISSION); - } - - @Override - protected void execute(CommandSender cs, String[] args) { - Calibrator c = new Calibrator(AntiCheat.getPlugin(), (Player) cs); - } -}