Revert a change made concerning consolecommands. They are now (again)

executed immediatly.
This commit is contained in:
Evenprime 2012-01-08 18:46:45 +01:00
parent c7db4113af
commit 768a9fb9a1
2 changed files with 11 additions and 20 deletions

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>cc.co.evenprime.bukkit</groupId>
<artifactId>NoCheat</artifactId>
<version>2.24</version>
<version>2.24a</version>
<packaging>jar</packaging>
<name>NoCheat</name>
<properties>

View File

@ -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) {