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,11 +54,14 @@ 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.
fplayer.sendMessage(message); for (FPlayer fplayer : myFaction.getFPlayers()) {
} else if (fplayer.isSpyingChat() && me != fplayer) { if (fplayer.getRole().isAtLeast(Role.MODERATOR)) {
fplayer.sendMessage("[MCspy]: " + message); fplayer.sendMessage(message);
} else if (fplayer.isSpyingChat() && me != fplayer) {
fplayer.sendMessage("[MCspy]: " + message);
}
} }
} }