- Added {worldname} as an accepted entry.

This commit is contained in:
ElgarL committed 2011-11-18 19:05:07 +00:00
1 parent 7629cddd02
commit 410ab57336
2 files changed
+8 -1

No files matched your search

+2 -1
View File
@@ -15,4 +15,5 @@ v0.5:
While in a chat mode you can still talk in other channels by using the channel commands eg. '/nc hi'.
While in a chat mode you can talk in global chat with '/g text here'.
to clear all chat modes '/g'.
- Added a new permission node for global chat ('/g') of 'towny.chat.global'.
- Added a new permission node for global chat ('/g') of 'towny.chat.global'.
- Added {worldname} as an accepted entry.
@@ -16,6 +16,12 @@ public class TownyChatFormatter {
private static StringReplaceManager<TownyChatEvent> replacer = new StringReplaceManager<TownyChatEvent>();
static {
replacer.registerFormatReplacement(Pattern.quote("{worldname}"), new TownyChatReplacerCallable() {
@Override
public String call(String match, TownyChatEvent event) throws Exception {
return String.format(TownySettings.getChatWorldFormat(), event.getEvent().getPlayer().getWorld().getName());
}
});
replacer.registerFormatReplacement(Pattern.quote("{town}"), new TownyChatReplacerCallable() {
@Override
public String call(String match, TownyChatEvent event) throws Exception {