diff options
Diffstat (limited to 'paper-server/patches/unapplied/net/minecraft/world/level/BaseCommandBlock.java.patch')
-rw-r--r-- | paper-server/patches/unapplied/net/minecraft/world/level/BaseCommandBlock.java.patch | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/paper-server/patches/unapplied/net/minecraft/world/level/BaseCommandBlock.java.patch b/paper-server/patches/unapplied/net/minecraft/world/level/BaseCommandBlock.java.patch new file mode 100644 index 0000000000..3c091f17a7 --- /dev/null +++ b/paper-server/patches/unapplied/net/minecraft/world/level/BaseCommandBlock.java.patch @@ -0,0 +1,39 @@ +--- a/net/minecraft/world/level/BaseCommandBlock.java ++++ b/net/minecraft/world/level/BaseCommandBlock.java +@@ -33,6 +33,10 @@ + private String command = ""; + @Nullable + private Component customName; ++ // CraftBukkit start ++ @Override ++ public abstract org.bukkit.command.CommandSender getBukkitSender(CommandSourceStack wrapper); ++ // CraftBukkit end + + public BaseCommandBlock() {} + +@@ -132,7 +136,7 @@ + + }); + +- minecraftserver.getCommands().performPrefixedCommand(commandlistenerwrapper, this.command); ++ minecraftserver.getCommands().dispatchServerCommand(commandlistenerwrapper, this.command); // CraftBukkit + } catch (Throwable throwable) { + CrashReport crashreport = CrashReport.forThrowable(throwable, "Executing command block"); + CrashReportCategory crashreportsystemdetails = crashreport.addCategory("Command to be executed"); +@@ -174,6 +178,7 @@ + @Override + public void sendSystemMessage(Component message) { + if (this.trackOutput) { ++ org.spigotmc.AsyncCatcher.catchOp("sendSystemMessage to a command block"); // Paper - Don't broadcast messages to command blocks + SimpleDateFormat simpledateformat = BaseCommandBlock.TIME_FORMAT; + Date date = new Date(); + +@@ -200,7 +205,7 @@ + } + + public InteractionResult usedBy(Player player) { +- if (!player.canUseGameMasterBlocks()) { ++ if (!player.canUseGameMasterBlocks() && (!player.isCreative() || !player.getBukkitEntity().hasPermission("minecraft.commandblock"))) { // Paper - command block permission + return InteractionResult.PASS; + } else { + if (player.getCommandSenderWorld().isClientSide) { |