Mod chat issue fix.

This commit is contained in:
ProSavage 2018-07-17 09:36:46 -05:00
parent 3543030e64
commit cfb64ea316

View File

@ -54,13 +54,16 @@ public class FactionsChatListener implements Listener {
String message = String.format(Conf.modChatFormat, ChatColor.stripColor(me.getNameAndTag()), msg); String message = String.format(Conf.modChatFormat, ChatColor.stripColor(me.getNameAndTag()), msg);
//Send to all mods //Send to all mods
for (FPlayer fplayer : FPlayers.getInstance().getOnlinePlayers()) { if (me.getRole().isAtLeast(Role.MODERATOR)) {
if (myFaction == fplayer.getFaction() && fplayer.getRole().isAtLeast(Role.MODERATOR)) { // Iterates only through the factions' members so we enhance performance.
for (FPlayer fplayer : myFaction.getFPlayers()) {
if (fplayer.getRole().isAtLeast(Role.MODERATOR)) {
fplayer.sendMessage(message); fplayer.sendMessage(message);
} else if (fplayer.isSpyingChat() && me != fplayer) { } else if (fplayer.isSpyingChat() && me != fplayer) {
fplayer.sendMessage("[MCspy]: " + message); fplayer.sendMessage("[MCspy]: " + message);
} }
} }
}
Bukkit.getLogger().log(Level.INFO, ChatColor.stripColor("Mod Chat: " + message)); Bukkit.getLogger().log(Level.INFO, ChatColor.stripColor("Mod Chat: " + message));