summaryrefslogtreecommitdiffstats
path: root/EssentialsChat/src/com
diff options
context:
space:
mode:
authorsnowleo <schneeleo@gmail.com>2012-01-19 02:03:20 +0100
committersnowleo <schneeleo@gmail.com>2012-01-19 02:03:20 +0100
commitd326a1fcea9668445f1ba06a1bc9fd4fce7b64f8 (patch)
tree599da3965d461e3a7781be952e1cc2cc20231961 /EssentialsChat/src/com
parent03a748c027d3e8a60560760f59e029905b11ac45 (diff)
downloadEssentials-d326a1fcea9668445f1ba06a1bc9fd4fce7b64f8.tar
Essentials-d326a1fcea9668445f1ba06a1bc9fd4fce7b64f8.tar.gz
Essentials-d326a1fcea9668445f1ba06a1bc9fd4fce7b64f8.tar.lz
Essentials-d326a1fcea9668445f1ba06a1bc9fd4fce7b64f8.tar.xz
Essentials-d326a1fcea9668445f1ba06a1bc9fd4fce7b64f8.zip
Cache MessageFormats for Chat
Diffstat (limited to 'EssentialsChat/src/com')
-rw-r--r--EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java4
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)}));
}
}