From 15181a7c74ff88929d8edad52261efd517199655 Mon Sep 17 00:00:00 2001 From: Jake Potrebic <jake.m.potrebic@gmail.com> Date: Tue, 14 Jun 2022 01:51:53 -0700 Subject: [PATCH] Fix command signs patch update (#7976) --- .../Fix-commands-from-signs-not-firing-command-events.patch | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/patches/server/Fix-commands-from-signs-not-firing-command-events.patch b/patches/server/Fix-commands-from-signs-not-firing-command-events.patch index 4bd198288d..0a22964947 100644 --- a/patches/server/Fix-commands-from-signs-not-firing-command-events.patch +++ b/patches/server/Fix-commands-from-signs-not-firing-command-events.patch @@ -70,9 +70,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public SignBlockEntity(BlockPos pos, BlockState state) { super(BlockEntityType.SIGN, pos, state); @@ -0,0 +0,0 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C + ClickEvent chatclickable = chatmodifier.getClickEvent(); if (chatclickable != null && chatclickable.getAction() == ClickEvent.Action.RUN_COMMAND) { - player.getServer().getCommands().performPrefixedCommand(this.createCommandSourceStack(player), chatclickable.getValue()); +- player.getServer().getCommands().performPrefixedCommand(this.createCommandSourceStack(player), chatclickable.getValue()); + // Paper start + String command = chatclickable.getValue().startsWith("/") ? chatclickable.getValue() : "/" + chatclickable.getValue(); + if (org.spigotmc.SpigotConfig.logCommands) { @@ -82,7 +83,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + if (!event.callEvent()) { + return false; + } -+ player.getServer().getCommands().performCommand(this.createCommandSourceStack(((org.bukkit.craftbukkit.entity.CraftPlayer) event.getPlayer()).getHandle()), event.getMessage()); ++ player.getServer().getCommands().performPrefixedCommand(this.createCommandSourceStack(((org.bukkit.craftbukkit.entity.CraftPlayer) event.getPlayer()).getHandle()), event.getMessage()); + // Paper end } }