Commits

Thinkofname authored ed60c017942
SPIGOT-2134: Use the correct listener in CommandExecute
No tags

nms-patches/CommandExecute.patch

Modified
34 34 - int j = icommandhandler.a(icommandlistener1, s);
35 35 + // CraftBukkit start
36 36 + org.bukkit.command.CommandSender sender = null;
37 37 + ICommandListener listener = icommandlistener;
38 38 + while (sender == null) {
39 39 + if (listener instanceof DedicatedServer) {
40 40 + sender = minecraftserver.server.getConsoleSender();
41 41 + } else if (listener instanceof CommandBlockListenerAbstract) {
42 42 + sender = ((CommandBlockListenerAbstract) listener).sender;
43 43 + } else if (listener instanceof ProxyListener) {
44 -+ listener = ((ProxyListener) icommandlistener).base; // Search deeper
44 ++ listener = ((ProxyListener) listener).base; // Search deeper
45 45 + } else if (VanillaCommandWrapper.lastSender != null) {
46 46 + sender = VanillaCommandWrapper.lastSender;
47 47 + } else if (listener.f() != null) {
48 48 + sender = listener.f().getBukkitEntity();
49 49 + } else {
50 50 + throw new CommandException("Unhandled executor " + icommandlistener.getClass().getSimpleName(), new Object[0]);
51 51 + }
52 52 + }
53 53 + int j = CommandBlockListenerAbstract.executeCommand(icommandlistener1, new ProxiedNativeCommandSender(icommandlistener1, sender, entity.getBukkitEntity()), s);
54 54 + // CraftBukkit end

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut