From ec718f04d7afeefd62e6fca7b56c780b2c172ca2 Mon Sep 17 00:00:00 2001 From: GJ Date: Tue, 12 Feb 2013 19:18:33 -0500 Subject: [PATCH] No sense in looping through all online players. --- .../java/com/gmail/nossr50/chat/ChatManager.java | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/chat/ChatManager.java b/src/main/java/com/gmail/nossr50/chat/ChatManager.java index 75a965b3c..81c63247a 100644 --- a/src/main/java/com/gmail/nossr50/chat/ChatManager.java +++ b/src/main/java/com/gmail/nossr50/chat/ChatManager.java @@ -10,7 +10,6 @@ import com.gmail.nossr50.events.chat.McMMOAdminChatEvent; import com.gmail.nossr50.events.chat.McMMOPartyChatEvent; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.party.Party; -import com.gmail.nossr50.util.Permissions; public final class ChatManager { public ChatManager () {} @@ -30,14 +29,8 @@ public final class ChatManager { String adminMessage = chatEvent.getMessage(); - for (Player otherPlayer : mcMMO.p.getServer().getOnlinePlayers()) { - if (Permissions.adminChat(otherPlayer) || otherPlayer.isOp()) { - otherPlayer.sendMessage(LocaleLoader.getString("Commands.AdminChat.Prefix", displayName) + adminMessage); - } - } - - displayName = ChatColor.stripColor(displayName); - mcMMO.p.getLogger().info("[A]<" + displayName + "> " + adminMessage); + mcMMO.p.getServer().broadcast(LocaleLoader.getString("Commands.AdminChat.Prefix", displayName) + adminMessage, "mcmmo.chat.admin"); + mcMMO.p.getLogger().info("[A]<" + ChatColor.stripColor(displayName) + "> " + adminMessage); } public static void handleAdminChat(Plugin plugin, String senderName, String message) { @@ -65,8 +58,7 @@ public final class ChatManager { member.sendMessage(LocaleLoader.getString("Commands.Party.Chat.Prefix", displayName) + partyMessage); } - displayName = ChatColor.stripColor(displayName); - mcMMO.p.getLogger().info("[P](" + partyName + ")" + "<" + displayName + "> " + partyMessage); + mcMMO.p.getLogger().info("[P](" + partyName + ")" + "<" + ChatColor.stripColor(displayName) + "> " + partyMessage); } public static void handlePartyChat(Plugin plugin, Party party, String senderName, String message) {