Server Commands and Remote Commands are now Cancellable.

This commit is contained in:
Matt
2015-07-12 19:54:34 +10:00
committed by md_5
parent a03743b3b4
commit 8f9ff9f6fd
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);