mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-11 17:15:07 +02:00
Cache MessageFormats for Chat
This commit is contained in:
@@ -42,6 +42,8 @@ public class EssentialsChatPlayerListenerLowest extends EssentialsChatPlayer
|
||||
{
|
||||
event.setMessage(Util.stripColor(event.getMessage()));
|
||||
}
|
||||
event.setFormat(ess.getSettings().getChatFormat(user.getGroup()).replace('&', '\u00a7').replace("\u00a7\u00a7", "&").replace("{DISPLAYNAME}", "%1$s").replace("{GROUP}", user.getGroup()).replace("{MESSAGE}", "%2$s").replace("{WORLDNAME}", user.getWorld().getName()).replace("{SHORTWORLDNAME}", user.getWorld().getName().substring(0, 1).toUpperCase(Locale.ENGLISH)));
|
||||
String group = user.getGroup();
|
||||
String world = user.getWorld().getName();
|
||||
event.setFormat(ess.getSettings().getChatFormat(group).format(new Object[] {group, world, world.substring(0, 1).toUpperCase(Locale.ENGLISH)}));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user