diff options
author | snowleo <schneeleo@gmail.com> | 2012-01-20 05:20:37 +0100 |
---|---|---|
committer | snowleo <schneeleo@gmail.com> | 2012-01-20 05:20:37 +0100 |
commit | 792f70efa5f3a47f642360e97979fe841593384c (patch) | |
tree | bf119f53a3426f1016457d066820eb334eb393ac /EssentialsChat/src/com/earth2me | |
parent | 46298ae85895574a097b1dd10c46196ffa1a42d3 (diff) | |
download | Essentials-792f70efa5f3a47f642360e97979fe841593384c.tar Essentials-792f70efa5f3a47f642360e97979fe841593384c.tar.gz Essentials-792f70efa5f3a47f642360e97979fe841593384c.tar.lz Essentials-792f70efa5f3a47f642360e97979fe841593384c.tar.xz Essentials-792f70efa5f3a47f642360e97979fe841593384c.zip |
Update for new CraftBukkit Event Code
EssentialsSpawn can't be updated yet, because the new event system lacks dynamic priorities.
Diffstat (limited to 'EssentialsChat/src/com/earth2me')
5 files changed, 14 insertions, 8 deletions
diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChat.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChat.java index de0d14421..a81525f83 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChat.java +++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChat.java @@ -41,9 +41,9 @@ public class EssentialsChat extends JavaPlugin final EssentialsChatPlayerListenerLowest playerListenerLowest = new EssentialsChatPlayerListenerLowest(getServer(), ess, chatListener, chatStore); final EssentialsChatPlayerListenerNormal playerListenerNormal = new EssentialsChatPlayerListenerNormal(getServer(), ess, chatListener, chatStore); final EssentialsChatPlayerListenerHighest playerListenerHighest = new EssentialsChatPlayerListenerHighest(getServer(), ess, chatListener, chatStore); - pluginManager.registerEvent(Type.PLAYER_CHAT, playerListenerLowest, Priority.Lowest, this); - pluginManager.registerEvent(Type.PLAYER_CHAT, playerListenerNormal, Priority.Normal, this); - pluginManager.registerEvent(Type.PLAYER_CHAT, playerListenerHighest, Priority.Highest, this); + pluginManager.registerEvents(playerListenerLowest, this); + pluginManager.registerEvents(playerListenerNormal, this); + pluginManager.registerEvents(playerListenerHighest, this); LOGGER.info(_("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), "essentials team")); } diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java index 30abe9cf8..e19f0122f 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java +++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayer.java @@ -10,13 +10,12 @@ import java.util.logging.Logger; import org.bukkit.Location; import org.bukkit.Server; import org.bukkit.World; -import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; +import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerChatEvent; -import org.bukkit.event.player.PlayerListener; //TODO: Translate the local/spy tags -public abstract class EssentialsChatPlayer extends PlayerListener +public abstract class EssentialsChatPlayer implements Listener { protected transient IEssentials ess; protected final static Logger logger = Logger.getLogger("Minecraft"); diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerHighest.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerHighest.java index 35c140f6b..e8f785228 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerHighest.java +++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerHighest.java @@ -1,10 +1,10 @@ package com.earth2me.essentials.chat; -import com.earth2me.essentials.ChargeException; import com.earth2me.essentials.IEssentials; -import com.earth2me.essentials.User; import java.util.Map; import org.bukkit.Server; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; import org.bukkit.event.player.PlayerChatEvent; @@ -18,6 +18,7 @@ public class EssentialsChatPlayerListenerHighest extends EssentialsChatPlayer super(server, ess, listeners, chatStorage); } + @EventHandler(priority = EventPriority.HIGHEST) @Override public void onPlayerChat(final PlayerChatEvent event) { diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java index 32e60d75d..5a8cde62d 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java +++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerLowest.java @@ -6,6 +6,8 @@ import com.earth2me.essentials.Util; import java.util.Locale; import java.util.Map; import org.bukkit.Server; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; import org.bukkit.event.player.PlayerChatEvent; @@ -19,6 +21,7 @@ public class EssentialsChatPlayerListenerLowest extends EssentialsChatPlayer super(server, ess, listeners, chatStorage); } + @EventHandler(priority = EventPriority.LOWEST) @Override public void onPlayerChat(final PlayerChatEvent event) { diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerNormal.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerNormal.java index 16ebe8e7e..0c1661ce5 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerNormal.java +++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerNormal.java @@ -6,6 +6,8 @@ import com.earth2me.essentials.User; import java.util.Locale; import java.util.Map; import org.bukkit.Server; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; import org.bukkit.event.player.PlayerChatEvent; @@ -19,6 +21,7 @@ public class EssentialsChatPlayerListenerNormal extends EssentialsChatPlayer super(server, ess, listeners, chatStorage); } + @EventHandler(priority = EventPriority.NORMAL) @Override public void onPlayerChat(final PlayerChatEvent event) { |