From 53fac9f1b6c3aa44e7c5c93db2950cb1d6beadc3 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 8 Aug 2015 18:42:24 +1000 Subject: [PATCH] SPIGOT-1111: Fix ServerCommandEvent not being cancelled. --- 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 d33c97e328..e1210d26e8 100644 --- a/nms-patches/DedicatedServer.patch +++ b/nms-patches/DedicatedServer.patch @@ -162,7 +162,7 @@ super.B(); this.aO(); } -@@ -296,7 +362,14 @@ +@@ -296,7 +362,15 @@ while (!this.l.isEmpty()) { ServerCommand servercommand = (ServerCommand) this.l.remove(0); @@ -170,6 +170,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 @@ -178,7 +179,7 @@ } } -@@ -491,13 +564,60 @@ +@@ -491,13 +565,60 @@ } public String getPlugins() {