1
0
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:
snowleo
2012-01-19 02:03:20 +01:00
parent a10f6850e5
commit 5f04d1867c
3 changed files with 26 additions and 7 deletions

View File

@@ -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)}));
}
}