diff options
author | snowleo <schneeleo@gmail.com> | 2012-01-19 02:03:20 +0100 |
---|---|---|
committer | snowleo <schneeleo@gmail.com> | 2012-01-19 02:03:20 +0100 |
commit | 5f04d1867cc75fc0d31d74d301459f5ac89c55a6 (patch) | |
tree | 07f5b9b87cdbda6190c2b6336c98d275900fd5d7 /EssentialsChat/src/com/earth2me/essentials | |
parent | a10f6850e52c1a83530591fdfb77bc37aea604ff (diff) | |
download | Essentials-5f04d1867cc75fc0d31d74d301459f5ac89c55a6.tar Essentials-5f04d1867cc75fc0d31d74d301459f5ac89c55a6.tar.gz Essentials-5f04d1867cc75fc0d31d74d301459f5ac89c55a6.tar.lz Essentials-5f04d1867cc75fc0d31d74d301459f5ac89c55a6.tar.xz Essentials-5f04d1867cc75fc0d31d74d301459f5ac89c55a6.zip |
Cache MessageFormats for Chat
Diffstat (limited to 'EssentialsChat/src/com/earth2me/essentials')
-rw-r--r-- | EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java index 9419416b0..32e60d75d 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java +++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java @@ -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)})); } } |