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
This commit is contained in:
Jake Potrebic
2022-06-16 14:22:56 -07:00
parent 1f68916ac9
commit 5cf40e45af
2 changed files with 10 additions and 2 deletions

View File

@ -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);
}
}