diff --git a/src/ChatConfig.yml b/src/ChatConfig.yml index ab38719..bac9e2d 100644 --- a/src/ChatConfig.yml +++ b/src/ChatConfig.yml @@ -25,8 +25,10 @@ # {townycolor} - Towny name colour for king/mayor/resident # {group} - Players group name pulled from your permissions plugin - # {permuserprefix} - Permission user prefix. + # {permuserprefix} - Permission user prefix. # {permusersuffix} - Permission user suffix. + # {permgroupprefix} - Permission group prefix. + # {permgroupsuffix} - Permission group suffix. # {permprefix} - Permission group and user prefix. # {permsuffix} - Permission group and user suffix. @@ -95,6 +97,6 @@ # either by being along in the channel or out-of-range of another player in his chat channel, # that player will see a message saying they cannot be heard. alone_message: '[modify_alone_message]' - # This allows you to set your alone messaeg. + # This allows you to set your alone message. alone_message_string: '[modify_alone_message_string]' worlds: diff --git a/src/changelog.txt b/src/changelog.txt index 60cbe84..78140c5 100644 --- a/src/changelog.txt +++ b/src/changelog.txt @@ -195,4 +195,6 @@ v0.46: v0.47: - Add ability to use Bold (&l), Italics (&o), Underline (&n), Magic (&k), Strike (&m) and Reset (&r) in the channel_format lines/tag_formats/directly in the chat line. v0.48: - - Add new chatconfig tags {permuserprefix}, {permusersuffix}, used to show only user prefix and suffixes. Requires Towny 0.91.4.8 or newer to function properly! \ No newline at end of file + - Add new chatconfig tags {permuserprefix}, {permusersuffix}, used to show only user prefix and suffixes. Requires Towny 0.91.4.8 or newer to function properly! +v0.48: + - Add new chatconfig tags {permgroupprefix}, {permgroupsuffix}, used to show only group prefix and suffixes. Requires Towny 0.91.4.13 or newer to function properly! \ No newline at end of file diff --git a/src/com/palmergames/bukkit/TownyChat/TownyChatFormatter.java b/src/com/palmergames/bukkit/TownyChat/TownyChatFormatter.java index b26df31..d0fa978 100644 --- a/src/com/palmergames/bukkit/TownyChat/TownyChatFormatter.java +++ b/src/com/palmergames/bukkit/TownyChat/TownyChatFormatter.java @@ -166,6 +166,19 @@ public class TownyChatFormatter { } }); + replacer.registerFormatReplacement(Pattern.quote("{permgroupprefix}"), new TownyChatReplacerCallable() { + @Override + public String call(String match, LocalTownyChatEvent event) throws Exception { + return TownyUniverse.getPermissionSource().getPrefixSuffix(event.getResident(), "groupprefix"); + } + }); + replacer.registerFormatReplacement(Pattern.quote("{permgroupsuffix}"), new TownyChatReplacerCallable() { + @Override + public String call(String match, LocalTownyChatEvent event) throws Exception { + return TownyUniverse.getPermissionSource().getPrefixSuffix(event.getResident(), "groupsuffix"); + } + }); + replacer.registerFormatReplacement(Pattern.quote("{playername}"), new TownyChatReplacerCallable() { @Override diff --git a/src/plugin.yml b/src/plugin.yml index 2f24e83..0afbf9f 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -1,6 +1,6 @@ name: TownyChat main: com.palmergames.bukkit.TownyChat.Chat -version: 0.48 +version: 0.49 author: ElgarL, Shade, phrstbrn website: http://code.google.com/a/eclipselabs.org/p/towny/ description: >