Fix command signs patch update (#7976)

This commit is contained in:
Jake Potrebic 2022-06-14 01:51:53 -07:00 committed by GitHub
parent 16541757f7
commit b844286f48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,7 +58,7 @@ index 0000000000000000000000000000000000000000..01a2bc1feec808790bb93618ce46adb9
+ } + }
+} +}
diff --git a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java diff --git a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
index 831db5ee21938d71e99bf9d17b92a6ca15531740..6c96c3dde4e1b1b1b6952841edb41006e73737e9 100644 index 831db5ee21938d71e99bf9d17b92a6ca15531740..def4fdd2c7e4f925fa128692a744e5d10ae0203a 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java --- a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
@@ -40,6 +40,7 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C @@ -40,6 +40,7 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C
@ -69,10 +69,11 @@ index 831db5ee21938d71e99bf9d17b92a6ca15531740..6c96c3dde4e1b1b1b6952841edb41006
public SignBlockEntity(BlockPos pos, BlockState state) { public SignBlockEntity(BlockPos pos, BlockState state) {
super(BlockEntityType.SIGN, pos, state); super(BlockEntityType.SIGN, pos, state);
@@ -225,6 +226,17 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C @@ -224,7 +225,17 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C
ClickEvent chatclickable = chatmodifier.getClickEvent();
if (chatclickable != null && chatclickable.getAction() == ClickEvent.Action.RUN_COMMAND) { 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 + // Paper start
+ String command = chatclickable.getValue().startsWith("/") ? chatclickable.getValue() : "/" + chatclickable.getValue(); + String command = chatclickable.getValue().startsWith("/") ? chatclickable.getValue() : "/" + chatclickable.getValue();
+ if (org.spigotmc.SpigotConfig.logCommands) { + if (org.spigotmc.SpigotConfig.logCommands) {
@ -82,12 +83,12 @@ index 831db5ee21938d71e99bf9d17b92a6ca15531740..6c96c3dde4e1b1b1b6952841edb41006
+ if (!event.callEvent()) { + if (!event.callEvent()) {
+ return false; + 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 + // Paper end
} }
} }
@@ -260,8 +272,21 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C @@ -260,8 +271,21 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C
String s = player == null ? "Sign" : player.getName().getString(); String s = player == null ? "Sign" : player.getName().getString();
Object object = player == null ? Component.literal("Sign") : player.getDisplayName(); Object object = player == null ? Component.literal("Sign") : player.getDisplayName();