aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/unapplied/server/0705-Don-t-broadcast-messages-to-command-blocks.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/unapplied/server/0705-Don-t-broadcast-messages-to-command-blocks.patch')
-rw-r--r--patches/unapplied/server/0705-Don-t-broadcast-messages-to-command-blocks.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/patches/unapplied/server/0705-Don-t-broadcast-messages-to-command-blocks.patch b/patches/unapplied/server/0705-Don-t-broadcast-messages-to-command-blocks.patch
new file mode 100644
index 0000000000..e27e3d40a7
--- /dev/null
+++ b/patches/unapplied/server/0705-Don-t-broadcast-messages-to-command-blocks.patch
@@ -0,0 +1,34 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jake Potrebic <[email protected]>
+Date: Thu, 16 Jun 2022 14:22:56 -0700
+Subject: [PATCH] Don't broadcast messages to command blocks
+
+Previously the broadcast method would update the last output
+in command blocks, and if called asynchronously, would throw
+an error
+
+diff --git a/src/main/java/net/minecraft/world/level/BaseCommandBlock.java b/src/main/java/net/minecraft/world/level/BaseCommandBlock.java
+index a0e59b236dff1f861a0e987764a77ee203504412..5cb39f95bd2d45b6c18554605f01d2ebf6473428 100644
+--- a/src/main/java/net/minecraft/world/level/BaseCommandBlock.java
++++ b/src/main/java/net/minecraft/world/level/BaseCommandBlock.java
+@@ -178,6 +178,7 @@ public abstract class BaseCommandBlock implements CommandSource {
+ @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();
+
+diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+index 557eb1a75a3115c3215315deae56a42d665693df..e890f87c66e95e7d4f130c4c659c6662b4f4bd94 100644
+--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
++++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+@@ -1928,7 +1928,7 @@ public final class CraftServer implements Server {
+ // Paper end
+ Set<CommandSender> recipients = new HashSet<>();
+ for (Permissible permissible : this.getPluginManager().getPermissionSubscriptions(permission)) {
+- if (permissible instanceof CommandSender && permissible.hasPermission(permission)) {
++ if (permissible instanceof CommandSender && !(permissible instanceof org.bukkit.command.BlockCommandSender) && permissible.hasPermission(permission)) { // Paper - Don't broadcast messages to command blocks
+ recipients.add((CommandSender) permissible);
+ }
+ }