mirror of
https://github.com/darksaid98/TownyChat.git
synced 2026-12-04 14:38:58 +00:00
- Added {worldname} as an accepted entry.
This commit is contained in:
1 parent
7629cddd02
commit
410ab57336
2 files changed
+8
-1
No files matched your search
+2
-1
@@ -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 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'.
|
While in a chat mode you can talk in global chat with '/g text here'.
|
||||||
to clear all chat modes '/g'.
|
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>();
|
private static StringReplaceManager<TownyChatEvent> replacer = new StringReplaceManager<TownyChatEvent>();
|
||||||
|
|
||||||
static {
|
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() {
|
replacer.registerFormatReplacement(Pattern.quote("{town}"), new TownyChatReplacerCallable() {
|
||||||
@Override
|
@Override
|
||||||
public String call(String match, TownyChatEvent event) throws Exception {
|
public String call(String match, TownyChatEvent event) throws Exception {
|
||||||
|
|||||||
Reference in new issue
Block a user