From c5d0d74eaeb376689713dfacbf25b976ceb6259f Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Fri, 28 Nov 2014 20:20:03 +0000 Subject: [PATCH] Improve vanilla command handling for command blocks --- .../CommandBlockListenerAbstract.patch | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/nms-patches/CommandBlockListenerAbstract.patch b/nms-patches/CommandBlockListenerAbstract.patch index 8e3ad8ebe0..0bad2a434e 100644 --- a/nms-patches/CommandBlockListenerAbstract.patch +++ b/nms-patches/CommandBlockListenerAbstract.patch @@ -1,5 +1,5 @@ ---- ../work/decompile-8eb82bde//net/minecraft/server/CommandBlockListenerAbstract.java 2014-11-28 17:43:42.989707437 +0000 -+++ src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java 2014-11-28 17:38:21.000000000 +0000 +--- ../work/decompile-8eb82bde//net/minecraft/server/CommandBlockListenerAbstract.java 2014-11-28 20:19:48.021499587 +0000 ++++ src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java 2014-11-28 20:18:58.289500691 +0000 @@ -4,6 +4,13 @@ import java.util.Date; import java.util.concurrent.Callable; @@ -22,7 +22,7 @@ public CommandBlockListenerAbstract() {} -@@ -79,7 +87,109 @@ +@@ -79,7 +87,110 @@ try { this.d = null; @@ -53,12 +53,13 @@ + } + + // Handle vanilla commands; ++ org.bukkit.command.Command commandBlockCommand = commandMap.getCommand(args[0]); + if (minecraftserver.server.getCommandBlockOverride(args[0])) { -+ org.bukkit.command.Command commandBlockCommand = commandMap.getCommand("minecraft:" + args[0]); -+ if (commandBlockCommand instanceof VanillaCommandWrapper) { -+ this.b = ((VanillaCommandWrapper) commandBlockCommand).dispatchVanillaCommandBlock(this, this.e); -+ return; -+ } ++ commandBlockCommand = commandMap.getCommand("minecraft:" + args[0]); ++ } ++ if (commandBlockCommand instanceof VanillaCommandWrapper) { ++ this.b = ((VanillaCommandWrapper) commandBlockCommand).dispatchVanillaCommandBlock(this, this.e); ++ return; + } + + // Make sure this is a valid command @@ -133,7 +134,7 @@ } catch (Throwable throwable) { CrashReport crashreport = CrashReport.a(throwable, "Executing command block"); CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Command to be executed"); -@@ -91,8 +201,26 @@ +@@ -91,8 +202,26 @@ } else { this.b = 0; }