mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 03:43:40 +01:00
Apply commandBlockOutput to broadcastMessage. Addresses BUKKIT-3117
By: feildmaster <admin@feildmaster.com>
This commit is contained in:
parent
a5f7cfdd0a
commit
9711df6414
1 changed files with 7 additions and 1 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Reference in a new issue