summaryrefslogtreecommitdiffstats
path: root/nms-patches/CustomFunction.patch
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2017-06-26 08:27:25 +1000
committermd_5 <git@md-5.net>2017-06-26 08:27:25 +1000
commitde7608559660c92d43e52099325155fa2758561b (patch)
tree69d53151774e63b092467f6de83793e0a49b8f58 /nms-patches/CustomFunction.patch
parent258575110f7c0abc0e3c8b85254b22b28fca27b1 (diff)
downloadcraftbukkit-de7608559660c92d43e52099325155fa2758561b.tar
craftbukkit-de7608559660c92d43e52099325155fa2758561b.tar.gz
craftbukkit-de7608559660c92d43e52099325155fa2758561b.tar.lz
craftbukkit-de7608559660c92d43e52099325155fa2758561b.tar.xz
craftbukkit-de7608559660c92d43e52099325155fa2758561b.zip
SPIGOT-3376: Fix nested functions
Diffstat (limited to 'nms-patches/CustomFunction.patch')
-rw-r--r--nms-patches/CustomFunction.patch12
1 files changed, 10 insertions, 2 deletions
diff --git a/nms-patches/CustomFunction.patch b/nms-patches/CustomFunction.patch
index ea37c185..a01167d4 100644
--- a/nms-patches/CustomFunction.patch
+++ b/nms-patches/CustomFunction.patch
@@ -1,11 +1,19 @@
--- a/net/minecraft/server/CustomFunction.java
+++ b/net/minecraft/server/CustomFunction.java
-@@ -122,7 +122,7 @@
+@@ -122,7 +122,15 @@
}
public void a(CustomFunctionData customfunctiondata, ICommandListener icommandlistener, ArrayDeque<CustomFunctionData.a> arraydeque, int i) {
- customfunctiondata.a().a(icommandlistener, this.a);
-+ CommandBlockListenerAbstract.executeSafely(icommandlistener, ((CustomFunctionData.CustomFunctionListener) icommandlistener).sender, this.a); // CraftBukkit
++ // CraftBukkit start
++ org.bukkit.command.CommandSender sender;
++ if (icommandlistener instanceof CustomFunctionData.CustomFunctionListener) {
++ sender = ((CustomFunctionData.CustomFunctionListener) icommandlistener).sender;
++ } else {
++ sender = CommandBlockListenerAbstract.unwrapSender(icommandlistener);
++ }
++ CommandBlockListenerAbstract.executeSafely(icommandlistener, sender, this.a);
++ // CraftBukkit end
}
public String toString() {