From 768a9fb9a147b442f771a649fbf8fa2844e1f5e5 Mon Sep 17 00:00:00 2001 From: Evenprime Date: Sun, 8 Jan 2012 18:46:45 +0100 Subject: [PATCH] Revert a change made concerning consolecommands. They are now (again) executed immediatly. --- pom.xml | 2 +- .../bukkit/nocheat/checks/Check.java | 29 +++++++------------ 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/pom.xml b/pom.xml index 7a99eb48..4972c471 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 cc.co.evenprime.bukkit NoCheat - 2.24 + 2.24a jar NoCheat diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/Check.java b/src/cc/co/evenprime/bukkit/nocheat/checks/Check.java index df2294ca..98d58c61 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/Check.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/Check.java @@ -1,12 +1,9 @@ package cc.co.evenprime.bukkit.nocheat.checks; import java.util.Locale; - -import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.command.CommandException; import org.bukkit.command.CommandSender; - import cc.co.evenprime.bukkit.nocheat.NoCheat; import cc.co.evenprime.bukkit.nocheat.NoCheatPlayer; import cc.co.evenprime.bukkit.nocheat.actions.Action; @@ -21,10 +18,10 @@ import cc.co.evenprime.bukkit.nocheat.data.ExecutionHistory; public abstract class Check { - private final String name; - private final String permission; + private final String name; + private final String permission; private static final CommandSender noCheatCommandSender = new NoCheatCommandSender(); - protected final NoCheat plugin; + protected final NoCheat plugin; public Check(NoCheat plugin, String name, String permission) { @@ -75,19 +72,13 @@ public abstract class Check { private final void executeConsoleCommand(ConsolecommandAction action, Check check, NoCheatPlayer player, ConfigurationCacheStore cc) { final String command = action.getCommand(player, check); - Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() { - - @Override - public void run() { - try { - plugin.getServer().dispatchCommand(noCheatCommandSender, command); - } catch(CommandException e) { - System.out.println("[NoCheat] failed to execute the command '" + command + "': " + e.getMessage() + ", please check if everything is setup correct."); - } catch(Exception e) { - // I don't care in this case, your problem if your command fails - } - } - }); + try { + plugin.getServer().dispatchCommand(noCheatCommandSender, command); + } catch(CommandException e) { + System.out.println("[NoCheat] failed to execute the command '" + command + "': " + e.getMessage() + ", please check if everything is setup correct."); + } catch(Exception e) { + // I don't care in this case, your problem if your command fails + } } public String getParameter(ParameterName wildcard, NoCheatPlayer player) {