diff --git a/src/changelog.txt b/src/changelog.txt index f038005..8fb34a4 100644 --- a/src/changelog.txt +++ b/src/changelog.txt @@ -17,4 +17,6 @@ v0.5: to clear all chat modes '/g'. - Added a new permission node for global chat ('/g') of 'towny.chat.global'. - Added {worldname} as an accepted entry. - - Fixed '/g' mode to add formatting. \ No newline at end of file + - Fixed '/g' mode to add formatting. +v0.6: + - Changed global chat to pass through bukkits chat process instead of our own (allows other plugins to see it again). \ No newline at end of file diff --git a/src/com/palmergames/bukkit/TownyChat/event/TownyPlayerHighestListener.java b/src/com/palmergames/bukkit/TownyChat/event/TownyPlayerHighestListener.java index 5d81468..00d4234 100644 --- a/src/com/palmergames/bukkit/TownyChat/event/TownyPlayerHighestListener.java +++ b/src/com/palmergames/bukkit/TownyChat/event/TownyPlayerHighestListener.java @@ -115,7 +115,16 @@ public class TownyPlayerHighestListener extends PlayerListener { parseNationChatCommand(event, "/nc", player); } else if (plugin.hasPlayerMode(player, "g")) { // Global chat - parseGlobalChannelChatCommand(event, "/g", player); + //parseGlobalChannelChatCommand(event, "/g", player); + + // This is Global chat. + if (TownySettings.isUsingModifyChat()) { + event.setFormat(TownySettings.getModifyChatFormat()); + } + + TownyChatEvent chatEvent = new TownyChatEvent(event, resident); + event.setFormat(TownyChatFormatter.getChatFormat(chatEvent)); + return; } else { for (String channel : TownySettings.getChatChannels()) { @@ -127,7 +136,7 @@ public class TownyPlayerHighestListener extends PlayerListener { } } - // All chat modes are disabled, or this is open chat. + // All chat modes are disabled, or this is Global chat. if (TownySettings.isUsingModifyChat()) { event.setFormat(TownySettings.getModifyChatFormat()); } @@ -165,6 +174,7 @@ public class TownyPlayerHighestListener extends PlayerListener { TownyChatEvent chatEvent = new TownyChatEvent(event, resident); event.setFormat(TownyChatFormatter.getChatFormat(chatEvent)); + TownyMessaging.sendNationMessage(nation, chatEvent.getFormat().replace("%1$s", event.getPlayer().getDisplayName()).replace("%2$s", event.getMessage())); } catch (NotRegisteredException x) { TownyMessaging.sendErrorMsg(player, x.getError()); diff --git a/src/plugin.yml b/src/plugin.yml index 7981657..f471f6d 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -1,6 +1,6 @@ name: TownyChat main: com.palmergames.bukkit.TownyChat.Chat -version: 0.5 +version: 0.6 author: ElgarL website: http://code.google.com/a/eclipselabs.org/p/towny/ description: >