From de7608559660c92d43e52099325155fa2758561b Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 26 Jun 2017 08:27:25 +1000 Subject: SPIGOT-3376: Fix nested functions --- nms-patches/CustomFunction.patch | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'nms-patches/CustomFunction.patch') 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 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() { -- cgit v1.2.3