Server Commands and Remote Commands are now Cancellable.

By: Matt <mattbdev@outlook.com>
This commit is contained in:
CraftBukkit/Spigot
2015-07-12 19:54:34 +10:00
parent af2b41da07
commit b201f850d6
3 changed files with 51 additions and 38 deletions

View File

@@ -178,7 +178,7 @@
}
}
@@ -491,13 +564,57 @@
@@ -491,13 +564,60 @@
}
public String getPlugins() {
@@ -223,6 +223,9 @@
+ // Event changes start
+ RemoteServerCommandEvent event = new RemoteServerCommandEvent(remoteConsole, s);
+ server.getPluginManager().callEvent(event);
+ if (event.isCancelled()) {
+ return null;
+ }
+ // Event change end
+ ServerCommand serverCommand = new ServerCommand(event.getCommand(), RemoteControlCommandListener.getInstance());
+ server.dispatchServerCommand(remoteConsole, serverCommand);