From 38835bea33946458d3142b5f1ac595e9910b5bc1 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Fri, 27 Jan 2012 13:35:47 +0000 Subject: [PATCH] v0.16: - Lowered event priorities to HIGH to allow other plugins the chance to beat us to the event and cancel. --- .classpath | 4 ++-- src/changelog.txt | 4 +++- .../bukkit/TownyChat/channels/channelTypes.java | 3 ++- .../TownyChat/event/TownyPlayerHighestListener.java | 12 +++++++++--- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/.classpath b/.classpath index 77073b9..655df1c 100644 --- a/.classpath +++ b/.classpath @@ -2,8 +2,8 @@ - - + + diff --git a/src/changelog.txt b/src/changelog.txt index 9cd4d2e..55f746e 100644 --- a/src/changelog.txt +++ b/src/changelog.txt @@ -79,4 +79,6 @@ v0.14: - The default permission node for the global chat channel has changed to 'towny.chat.general' - TownyChat now registers is't permissions with Bukkit. v0.15: - - Updated for the new Bukkit Event system. \ No newline at end of file + - Updated for the new Bukkit Event system. +v0.16: + - Lowered event priorities to HIGH to allow other plugins the chance to beat us to the event and cancel. \ No newline at end of file diff --git a/src/com/palmergames/bukkit/TownyChat/channels/channelTypes.java b/src/com/palmergames/bukkit/TownyChat/channels/channelTypes.java index c4eb2b4..e80db01 100644 --- a/src/com/palmergames/bukkit/TownyChat/channels/channelTypes.java +++ b/src/com/palmergames/bukkit/TownyChat/channels/channelTypes.java @@ -5,5 +5,6 @@ public enum channelTypes { TOWN, NATION, DEFAULT, - GLOBAL + GLOBAL, + PRIVATE } \ 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 7351925..aceef7d 100644 --- a/src/com/palmergames/bukkit/TownyChat/event/TownyPlayerHighestListener.java +++ b/src/com/palmergames/bukkit/TownyChat/event/TownyPlayerHighestListener.java @@ -43,9 +43,12 @@ public class TownyPlayerHighestListener implements Listener { this.dynMap = dynMap; } - @EventHandler(priority = EventPriority.HIGHEST) + @EventHandler(priority = EventPriority.HIGH) public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) { + if (event.isCancelled()) + return; + Player player = event.getPlayer(); // Test if this player is registered with Towny. @@ -63,7 +66,7 @@ public class TownyPlayerHighestListener implements Listener { Channel channel = plugin.getChannelsHandler().getChannel(player, command); if (channel != null) { - System.out.print("Channel Found"); + //System.out.print("Channel Found"); event.setMessage(message); @@ -94,9 +97,12 @@ public class TownyPlayerHighestListener implements Listener { } } - @EventHandler(priority = EventPriority.HIGHEST) + @EventHandler(priority = EventPriority.HIGH) public void onPlayerChat(PlayerChatEvent event) { + if (event.isCancelled()) + return; + Player player = event.getPlayer(); // Check if essentials has this player muted.