Merge pull request #63 from Vankka/master

Fix chat (2nd attempt)
This commit is contained in:
Naman 2018-11-24 23:04:59 -06:00 committed by GitHub
commit 0c626e74cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -179,10 +179,6 @@ public class FactionsChatListener implements Listener {
// Relation Colored?
if (Conf.chatTagRelationColored) {
// Messages are sent to players individually
// This still leaves a chance for other plugins to pick it up
event.setCancelled(true);
for (Player listeningPlayer : event.getRecipients()) {
FPlayer you = FPlayers.getInstance().getByPlayer(listeningPlayer);
String yourFormat = formatStart + me.getChatTag(you).trim() + formatEnd;
@ -197,9 +193,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);
// Messages are sent to players individually
// This still leaves a chance for other plugins to pick it up
event.getRecipients().clear();
}
// Message with no relation color.
event.setFormat(nonColoredMsgFormat);