From 9711df6414076788384d18e960c2f6a6a4416619 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Tue, 18 Dec 2012 04:47:56 -0600 Subject: [PATCH] Apply commandBlockOutput to broadcastMessage. Addresses BUKKIT-3117 By: feildmaster --- paper-api/src/main/java/org/bukkit/command/Command.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/paper-api/src/main/java/org/bukkit/command/Command.java b/paper-api/src/main/java/org/bukkit/command/Command.java index 1695742527..f43d7be34b 100644 --- a/paper-api/src/main/java/org/bukkit/command/Command.java +++ b/paper-api/src/main/java/org/bukkit/command/Command.java @@ -330,8 +330,14 @@ public abstract class Command { } public static void broadcastCommandMessage(CommandSender source, String message, boolean sendToSource) { - Set users = Bukkit.getPluginManager().getPermissionSubscriptions(Server.BROADCAST_CHANNEL_ADMINISTRATIVE); String result = source.getName() + ": " + message; + + if (source instanceof BlockCommandSender && ((BlockCommandSender) source).getBlock().getWorld().getGameRuleValue("commandBlockOutput").equalsIgnoreCase("false")) { + Bukkit.getConsoleSender().sendMessage(result); + return; + } + + Set users = Bukkit.getPluginManager().getPermissionSubscriptions(Server.BROADCAST_CHANNEL_ADMINISTRATIVE); String colored = ChatColor.GRAY + "" + ChatColor.ITALIC + "[" + result + "]"; if (sendToSource && !(source instanceof ConsoleCommandSender)) {