From 36f7552aab2d8e5426f4e4a6863ffdd1611f7761 Mon Sep 17 00:00:00 2001 From: Vankka Date: Sun, 18 Nov 2018 16:46:06 +0200 Subject: [PATCH] Clear recipient list instead of canceling the chat message --- .../factions/listeners/FactionsChatListener.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/massivecraft/factions/listeners/FactionsChatListener.java b/src/main/java/com/massivecraft/factions/listeners/FactionsChatListener.java index d9150a44..d530158c 100644 --- a/src/main/java/com/massivecraft/factions/listeners/FactionsChatListener.java +++ b/src/main/java/com/massivecraft/factions/listeners/FactionsChatListener.java @@ -179,9 +179,9 @@ public class FactionsChatListener implements Listener { // Relation Colored? if (Conf.chatTagRelationColored) { - // We must choke the standard message and send out individual messages to all players - // Why? Because the relations will differ. - event.setCancelled(true); + // Messages are sent to players individually + // This still leaves a chance for other plugins to pick it up + event.getRecipients().clear(); for (Player listeningPlayer : event.getRecipients()) { FPlayer you = FPlayers.getInstance().getByPlayer(listeningPlayer); @@ -200,10 +200,9 @@ public class FactionsChatListener implements Listener { // Write to the log... We will write the non colored message. String nonColoredMsg = ChatColor.stripColor(String.format(nonColoredMsgFormat, talkingPlayer.getDisplayName(), msg)); Bukkit.getLogger().log(Level.INFO, nonColoredMsg); - } else { - // No relation color. - event.setFormat(nonColoredMsgFormat); } + // Message with no relation color. + event.setFormat(nonColoredMsgFormat); } private void doWarmup(final String warp, final FPlayer fme) {