2022-06-17 00:03:02 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
|
|
|
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
|
2024-04-30 00:16:07 +02:00
|
|
|
index 8c2dcc4134d96351cee75773214f3f47e71533e9..e6bfcc50cdf728216084bc00a5bb8b6b3b8f72e4 100644
|
2022-06-17 00:03:02 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/level/BaseCommandBlock.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/level/BaseCommandBlock.java
|
2024-04-30 00:16:07 +02:00
|
|
|
@@ -178,6 +178,7 @@ public abstract class BaseCommandBlock implements CommandSource {
|
2022-06-17 00:03:02 +02:00
|
|
|
@Override
|
|
|
|
public void sendSystemMessage(Component message) {
|
|
|
|
if (this.trackOutput) {
|
2024-01-18 15:56:25 +01:00
|
|
|
+ org.spigotmc.AsyncCatcher.catchOp("sendSystemMessage to a command block"); // Paper - Don't broadcast messages to command blocks
|
2022-06-17 00:03:02 +02:00
|
|
|
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
|
2024-08-31 20:29:50 +02:00
|
|
|
index f1422bd50cd10f64c9c73e3ac3a93ff9e94d6265..0274b574e80e133ec1b5033ae09450d2d57db894 100644
|
2022-06-17 00:03:02 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
2024-07-18 10:13:20 +02:00
|
|
|
@@ -1923,7 +1923,7 @@ public final class CraftServer implements Server {
|
2022-06-17 00:03:02 +02:00
|
|
|
// Paper end
|
|
|
|
Set<CommandSender> recipients = new HashSet<>();
|
|
|
|
for (Permissible permissible : this.getPluginManager().getPermissionSubscriptions(permission)) {
|
|
|
|
- if (permissible instanceof CommandSender && permissible.hasPermission(permission)) {
|
2024-01-18 15:56:25 +01:00
|
|
|
+ if (permissible instanceof CommandSender && !(permissible instanceof org.bukkit.command.BlockCommandSender) && permissible.hasPermission(permission)) { // Paper - Don't broadcast messages to command blocks
|
2022-06-17 00:03:02 +02:00
|
|
|
recipients.add((CommandSender) permissible);
|
|
|
|
}
|
|
|
|
}
|