Apply commandBlockOutput to broadcastMessage. Addresses BUKKIT-3117

By: feildmaster <admin@feildmaster.com>
This commit is contained in:
Bukkit/Spigot 2012-12-18 04:47:56 -06:00
parent a5f7cfdd0a
commit 9711df6414

View file

@ -330,8 +330,14 @@ public abstract class Command {
}
public static void broadcastCommandMessage(CommandSender source, String message, boolean sendToSource) {
Set<Permissible> 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<Permissible> users = Bukkit.getPluginManager().getPermissionSubscriptions(Server.BROADCAST_CHANNEL_ADMINISTRATIVE);
String colored = ChatColor.GRAY + "" + ChatColor.ITALIC + "[" + result + "]";
if (sendToSource && !(source instanceof ConsoleCommandSender)) {