aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0718-Don-t-broadcast-messages-to-command-blocks.patch
diff options
context:
space:
mode:
authorNassim Jahnke <[email protected]>2024-06-16 12:56:00 +0200
committerNassim Jahnke <[email protected]>2024-06-16 12:56:00 +0200
commitdc684c60d16f66ea84467ec8e253f2a36a17a7c8 (patch)
treee516f1bd4bfbdb37a5aeee42384aade111eca3e1 /patches/server/0718-Don-t-broadcast-messages-to-command-blocks.patch
parent752f957e12e4ceb8b7d2043a4a7dbce786b7b98f (diff)
downloadPaper-dc684c60d16f66ea84467ec8e253f2a36a17a7c8.tar.gz
Paper-dc684c60d16f66ea84467ec8e253f2a36a17a7c8.zip
Remove bad server.scheduleOnMain disconnect calls from old patches
The new behavior of disconnect to block the current thread until the disconnect succeeded is better than throwing it off to happen at some point
Diffstat (limited to 'patches/server/0718-Don-t-broadcast-messages-to-command-blocks.patch')
-rw-r--r--patches/server/0718-Don-t-broadcast-messages-to-command-blocks.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/patches/server/0718-Don-t-broadcast-messages-to-command-blocks.patch b/patches/server/0718-Don-t-broadcast-messages-to-command-blocks.patch
new file mode 100644
index 0000000000..5a89b4427f
--- /dev/null
+++ b/patches/server/0718-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 8c2dcc4134d96351cee75773214f3f47e71533e9..e6bfcc50cdf728216084bc00a5bb8b6b3b8f72e4 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 986bbc91b82d3062ef1bf1542dd264f4154a7ea1..5e3488c3d318d8728238f0dc1ccde76817ac7716 100644
+--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
++++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+@@ -1914,7 +1914,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);
+ }
+ }