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
|
2022-11-03 22:03:31 +01:00
|
|
|
index 7c7e5f3c0f9cd1f16192a8fc8163da9b2d9519d5..888936385196a178ab8b730fd5e4fff4a5466428 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
|
|
|
|
@@ -172,6 +172,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
|
|
|
|
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
|
2023-04-16 18:49:13 +02:00
|
|
|
index 3713ce052cef9ccbee951473556cba6e0d1b485f..33fe6f01cfef25482001a04bdd82367424d69317 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
|
2023-04-16 18:49:13 +02:00
|
|
|
@@ -1768,7 +1768,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)) {
|
|
|
|
+ if (permissible instanceof CommandSender && !(permissible instanceof org.bukkit.command.BlockCommandSender) && permissible.hasPermission(permission)) { // Paper - don't broadcast to BlockCommandSender (specifically Command Blocks)
|
|
|
|
recipients.add((CommandSender) permissible);
|
|
|
|
}
|
|
|
|
}
|