From f5f09ffcbfbe6be42aa2ac3777d835cdeaccfffb Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 3 Mar 2016 16:56:07 +1100 Subject: [PATCH] SPIGOT-1634: Fix cancelling ServerCommandEvent --- nms-patches/DedicatedServer.patch | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nms-patches/DedicatedServer.patch b/nms-patches/DedicatedServer.patch index 414085ff94..c259355e63 100644 --- a/nms-patches/DedicatedServer.patch +++ b/nms-patches/DedicatedServer.patch @@ -161,7 +161,7 @@ super.D(); this.aL(); } -@@ -329,7 +388,14 @@ +@@ -329,7 +388,15 @@ while (!this.serverCommandQueue.isEmpty()) { ServerCommand servercommand = (ServerCommand) this.serverCommandQueue.remove(0); @@ -169,6 +169,7 @@ + // CraftBukkit start - ServerCommand for preprocessing + ServerCommandEvent event = new ServerCommandEvent(console, servercommand.command); + server.getPluginManager().callEvent(event); ++ if (event.isCancelled()) continue; + servercommand = new ServerCommand(event.getCommand(), servercommand.source); + + // this.getCommandHandler().a(servercommand.source, servercommand.command); // Called in dispatchServerCommand @@ -177,7 +178,7 @@ } } -@@ -536,16 +602,70 @@ +@@ -536,16 +603,70 @@ } public String getPlugins() {