mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-01-01 05:18:00 +01:00
Revert a change made concerning consolecommands. They are now (again)
executed immediatly.
This commit is contained in:
parent
c7db4113af
commit
768a9fb9a1
2
pom.xml
2
pom.xml
@ -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>
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user