diff --git a/pom.xml b/pom.xml index a006599..fccc2ef 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ com.palmergames.bukkit TownyChat jar - 0.98 + 0.99 diff --git a/resources/changelog.txt b/resources/changelog.txt index 285bad5..d54b1cf 100644 --- a/resources/changelog.txt +++ b/resources/changelog.txt @@ -422,4 +422,7 @@ v0.98: - Replace TownyChatReplacerCallable with TownyChatReplacer. - Makes use of Functions to do what the old Callable did. - Refactor a bunch of the plugin to get rid of old/ugly code. - - There is a chance that some 3rd party chat plugins will break. Let me know about this asap. \ No newline at end of file + - There is a chance that some 3rd party chat plugins will break. Let me know about this asap. +v0.99: + - Allow for players to use !message to send chat to a Global channel. + - Will not work when chat is being directed to a channel, ie: /nc !chat message. \ No newline at end of file diff --git a/src/com/palmergames/bukkit/TownyChat/listener/TownyChatPlayerListener.java b/src/com/palmergames/bukkit/TownyChat/listener/TownyChatPlayerListener.java index c8fe589..12d69dd 100644 --- a/src/com/palmergames/bukkit/TownyChat/listener/TownyChatPlayerListener.java +++ b/src/com/palmergames/bukkit/TownyChat/listener/TownyChatPlayerListener.java @@ -71,6 +71,8 @@ public class TownyChatPlayerListener implements Listener { // Check if essentials has this player muted. if (!isEssentialsMuted(player)) { + + boolean forceGlobal = event.getMessage().startsWith("!"); /* * If this was directed chat send it via the relevant channel @@ -96,7 +98,7 @@ public class TownyChatPlayerListener implements Listener { * Check the player for any channel modes. */ Channel channel = plugin.getPlayerChannel(player); - if (channel != null) { + if (!forceGlobal && channel != null) { if (isMutedOrSpam(event, channel, player)) return; channel.chatProcess(event); @@ -110,6 +112,8 @@ public class TownyChatPlayerListener implements Listener { if (channel != null) { if (isMutedOrSpam(event, channel, player)) return; + if (forceGlobal) + event.setMessage(event.getMessage().substring(1)); channel.chatProcess(event); return; }