diff options
author | Thinkofdeath <thinkofdeath@spigotmc.org> | 2014-11-28 20:20:03 +0000 |
---|---|---|
committer | Thinkofdeath <thinkofdeath@spigotmc.org> | 2014-11-28 20:20:03 +0000 |
commit | c5d0d74eaeb376689713dfacbf25b976ceb6259f (patch) | |
tree | 1178c280de9af2c60ede20b6bfaab0b5939b27cb /nms-patches | |
parent | 2575b3f9c0ed7ee9667eef437431e9cd12d2f16d (diff) | |
download | craftbukkit-c5d0d74eaeb376689713dfacbf25b976ceb6259f.tar craftbukkit-c5d0d74eaeb376689713dfacbf25b976ceb6259f.tar.gz craftbukkit-c5d0d74eaeb376689713dfacbf25b976ceb6259f.tar.lz craftbukkit-c5d0d74eaeb376689713dfacbf25b976ceb6259f.tar.xz craftbukkit-c5d0d74eaeb376689713dfacbf25b976ceb6259f.zip |
Improve vanilla command handling for command blocks
Diffstat (limited to 'nms-patches')
-rw-r--r-- | nms-patches/CommandBlockListenerAbstract.patch | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/nms-patches/CommandBlockListenerAbstract.patch b/nms-patches/CommandBlockListenerAbstract.patch index 8e3ad8eb..0bad2a43 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; } |