Clans Chat

This commit is contained in:
Shaun Bennett 2015-08-27 14:33:50 -07:00
parent b0ee2bb669
commit e86bca99fd

View File

@ -37,6 +37,7 @@ import mineplex.core.common.util.C;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.NautHashMap; import mineplex.core.common.util.NautHashMap;
import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilPlayer;
import mineplex.core.common.util.UtilServer;
import mineplex.core.creature.Creature; import mineplex.core.creature.Creature;
import mineplex.core.creature.event.CreatureSpawnCustomEvent; import mineplex.core.creature.event.CreatureSpawnCustomEvent;
import mineplex.core.disguise.DisguiseManager; import mineplex.core.disguise.DisguiseManager;
@ -485,7 +486,29 @@ public class ClansManager extends MiniClientPlugin<ClientClan> implements IRelat
return; return;
} }
event.getRecipients().clear();
event.setFormat(C.cGold + clan.getName() + " " + C.cYellow + "%1$s " + C.cWhite + "%2$s"); event.setFormat(C.cGold + clan.getName() + " " + C.cYellow + "%1$s " + C.cWhite + "%2$s");
for (Player other : UtilServer.getPlayers())
{
if (other.equals(event.getPlayer()))
continue;
ClanInfo otherClan = _clanUtility.getClanByPlayer(other);
if (otherClan == null)
{
event.getRecipients().add(other);
}
else
{
String message = event.getMessage();
message = _chat.getFilteredMessage(event.getPlayer(), message);
ClanRelation rel = _clanUtility.rel(clan, otherClan);
String formatted = rel.getColor(true) + clan.getName() + " " + rel.getColor(false) + event.getPlayer().getName() + " " + C.cWhite + message;
other.sendMessage(formatted);
}
}
} }
} }