Add color code support for chat format

This commit is contained in:
business-goose 2022-03-21 09:29:32 +00:00
parent 583e8909e9
commit 792f3d0590

View file

@ -628,7 +628,7 @@ public class PlayerListener implements Listener {
// Set the tag
if (playerdata.getTag() != null) {
//event.setFormat("<" + playerdata.getTag().replaceAll("%", "%%") + " %1$s> %2$s");
event.setFormat(MainConfig.getString(ConfigurationEntry.CHAT_FORMAT).replace("{RANK}", playerdata.getTag().replaceAll("%", "%%")));
event.setFormat(ChatColor.translateAlternateColorCodes('&', MainConfig.getString(ConfigurationEntry.CHAT_FORMAT)).replace("{RANK}", playerdata.getTag().replaceAll("%", "%%")));
}
DiscordBridge.transmitMessage(String.format(event.getFormat(), event.getPlayer().getDisplayName(), event.getMessage()));