diff options
author | md_5 <git@md-5.net> | 2017-06-25 09:46:19 +1000 |
---|---|---|
committer | md_5 <git@md-5.net> | 2017-06-25 09:46:19 +1000 |
commit | 258575110f7c0abc0e3c8b85254b22b28fca27b1 (patch) | |
tree | 6bf095cecdf15407d15990b70a4a6f0dbe35d2e9 | |
parent | 753a8e700db5216abcc53eb56a9c26226c1ad9ed (diff) | |
download | craftbukkit-258575110f7c0abc0e3c8b85254b22b28fca27b1.tar craftbukkit-258575110f7c0abc0e3c8b85254b22b28fca27b1.tar.gz craftbukkit-258575110f7c0abc0e3c8b85254b22b28fca27b1.tar.lz craftbukkit-258575110f7c0abc0e3c8b85254b22b28fca27b1.tar.xz craftbukkit-258575110f7c0abc0e3c8b85254b22b28fca27b1.zip |
SPIGOT-3373: Fix /execute in gameloop functions
-rw-r--r-- | nms-patches/CommandExecute.patch | 4 | ||||
-rw-r--r-- | nms-patches/CustomFunction.patch | 2 | ||||
-rw-r--r-- | nms-patches/CustomFunctionData.patch | 22 |
3 files changed, 23 insertions, 5 deletions
diff --git a/nms-patches/CommandExecute.patch b/nms-patches/CommandExecute.patch index 8fbfb2ea..bd31145b 100644 --- a/nms-patches/CommandExecute.patch +++ b/nms-patches/CommandExecute.patch @@ -11,7 +11,7 @@ public class CommandExecute extends CommandAbstract { -@@ -59,26 +63,59 @@ +@@ -59,26 +63,61 @@ } String s = a(astring, b0); @@ -31,6 +31,8 @@ + sender = minecraftserver.remoteConsole; + } else if (listener instanceof CommandBlockListenerAbstract) { + sender = ((CommandBlockListenerAbstract) listener).sender; ++ } else if (listener instanceof CustomFunctionData.CustomFunctionListener) { ++ sender = ((CustomFunctionData.CustomFunctionListener) listener).sender; + } else if (listener instanceof CommandListenerWrapper) { + listener = ((CommandListenerWrapper) listener).base; // Search deeper + } else if (VanillaCommandWrapper.lastSender != null) { diff --git a/nms-patches/CustomFunction.patch b/nms-patches/CustomFunction.patch index 28838ae8..ea37c185 100644 --- a/nms-patches/CustomFunction.patch +++ b/nms-patches/CustomFunction.patch @@ -5,7 +5,7 @@ public void a(CustomFunctionData customfunctiondata, ICommandListener icommandlistener, ArrayDeque<CustomFunctionData.a> arraydeque, int i) { - customfunctiondata.a().a(icommandlistener, this.a); -+ CommandBlockListenerAbstract.executeSafely(icommandlistener, new org.bukkit.craftbukkit.command.CraftFunctionCommandSender(icommandlistener), this.a); // CraftBukkit ++ CommandBlockListenerAbstract.executeSafely(icommandlistener, ((CustomFunctionData.CustomFunctionListener) icommandlistener).sender, this.a); // CraftBukkit } public String toString() { diff --git a/nms-patches/CustomFunctionData.patch b/nms-patches/CustomFunctionData.patch index f0baac84..821ff006 100644 --- a/nms-patches/CustomFunctionData.patch +++ b/nms-patches/CustomFunctionData.patch @@ -1,6 +1,22 @@ --- a/net/minecraft/server/CustomFunctionData.java +++ b/net/minecraft/server/CustomFunctionData.java -@@ -33,7 +33,7 @@ +@@ -23,7 +23,14 @@ + private CustomFunction f; + private final ArrayDeque<CustomFunctionData.a> g = new ArrayDeque(); + private boolean h = false; +- private final ICommandListener i = new ICommandListener() { ++ // CraftBukkit start ++ private final ICommandListener i = new CustomFunctionListener(); ++ ++ public class CustomFunctionListener implements ICommandListener { ++ ++ protected org.bukkit.command.CommandSender sender = new org.bukkit.craftbukkit.command.CraftFunctionCommandSender(this); ++ // CraftBukkit end ++ + public String getName() { + return CustomFunctionData.this.e; + } +@@ -33,7 +40,7 @@ } public World getWorld() { @@ -9,7 +25,7 @@ } public MinecraftServer C_() { -@@ -57,7 +57,7 @@ +@@ -57,7 +64,7 @@ } public int c() { @@ -18,7 +34,7 @@ } public Map<MinecraftKey, CustomFunction> d() { -@@ -65,7 +65,7 @@ +@@ -65,7 +72,7 @@ } public void e() { |