diff options
author | KHobbits <rob@khobbits.co.uk> | 2012-01-19 15:51:55 +0000 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2012-01-19 15:51:55 +0000 |
commit | d08b1a5089c24d9343d13f6252a7fc27bd694173 (patch) | |
tree | 1b3fd9b42ce5111d59e34b0cfe62fc6889bf29e0 | |
parent | e015cad131dc5167ce56d5dc3689f0d78e7aef85 (diff) | |
download | Essentials-d08b1a5089c24d9343d13f6252a7fc27bd694173.tar Essentials-d08b1a5089c24d9343d13f6252a7fc27bd694173.tar.gz Essentials-d08b1a5089c24d9343d13f6252a7fc27bd694173.tar.lz Essentials-d08b1a5089c24d9343d13f6252a7fc27bd694173.tar.xz Essentials-d08b1a5089c24d9343d13f6252a7fc27bd694173.zip |
Fix EssChat displayname error.
-rw-r--r-- | Essentials/src/com/earth2me/essentials/Settings.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index 995d58643..e25683e32 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -303,11 +303,13 @@ public class Settings implements ISettings String format = config.getString("chat.group-formats." + (group == null ? "Default" : group), config.getString("chat.format", "&7[{GROUP}]&f {DISPLAYNAME}&7:&f {MESSAGE}")); format = Util.replaceColor(format); - format.replace("{DISPLAYNAME}", "%1$s"); - format.replace("{GROUP}", "{0}"); - format.replace("{MESSAGE}", "%2$s"); - format.replace("{WORLDNAME}", "{1}"); - format.replace("{SHORTWORLDNAME}", "{2}"); + format = format.replace("{DISPLAYNAME}", "%1$s"); + format = format.replace("{GROUP}", "{0}"); + format = format.replace("{MESSAGE}", "%2$s"); + format = format.replace("{WORLDNAME}", "{1}"); + format = format.replace("{SHORTWORLDNAME}", "{2}"); + format = format.replaceAll("\\{(\\D*)\\}", "\\[$1\\]"); + logger.log(Level.INFO, "debug-format: " + format); mFormat = new MessageFormat(format); chatFormats.put(group, mFormat); } |