From 792f70efa5f3a47f642360e97979fe841593384c Mon Sep 17 00:00:00 2001 From: snowleo Date: Fri, 20 Jan 2012 05:20:37 +0100 Subject: Update for new CraftBukkit Event Code EssentialsSpawn can't be updated yet, because the new event system lacks dynamic priorities. --- .../src/com/earth2me/essentials/xmpp/EssentialsXMPP.java | 4 +--- .../essentials/xmpp/EssentialsXMPPPlayerListener.java | 12 +++++++----- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'EssentialsXMPP/src/com/earth2me') diff --git a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java index bcbbfa17d..65925c00a 100644 --- a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java +++ b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java @@ -47,9 +47,7 @@ public class EssentialsXMPP extends JavaPlugin implements IEssentialsXMPP } final EssentialsXMPPPlayerListener playerListener = new EssentialsXMPPPlayerListener(ess); - pluginManager.registerEvent(Type.PLAYER_JOIN, playerListener, Priority.Monitor, this); - pluginManager.registerEvent(Type.PLAYER_CHAT, playerListener, Priority.Monitor, this); - pluginManager.registerEvent(Type.PLAYER_QUIT, playerListener, Priority.Monitor, this); + pluginManager.registerEvents(playerListener, this); users = new UserManager(this.getDataFolder()); xmpp = new XMPPManager(this); diff --git a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPPPlayerListener.java b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPPPlayerListener.java index 47966aee0..1fa5a243c 100644 --- a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPPPlayerListener.java +++ b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPPPlayerListener.java @@ -2,13 +2,15 @@ package com.earth2me.essentials.xmpp; import com.earth2me.essentials.IEssentials; import com.earth2me.essentials.User; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerChatEvent; import org.bukkit.event.player.PlayerJoinEvent; -import org.bukkit.event.player.PlayerListener; import org.bukkit.event.player.PlayerQuitEvent; -class EssentialsXMPPPlayerListener extends PlayerListener +class EssentialsXMPPPlayerListener implements Listener { private final transient IEssentials ess; @@ -18,21 +20,21 @@ class EssentialsXMPPPlayerListener extends PlayerListener this.ess = ess; } - @Override + @EventHandler(priority= EventPriority.MONITOR) public void onPlayerJoin(final PlayerJoinEvent event) { final User user = ess.getUser(event.getPlayer()); sendMessageToSpyUsers("Player " + user.getDisplayName() + " joined the game"); } - @Override + @EventHandler(priority= EventPriority.MONITOR) public void onPlayerChat(final PlayerChatEvent event) { final User user = ess.getUser(event.getPlayer()); sendMessageToSpyUsers(String.format(event.getFormat(), user.getDisplayName(), event.getMessage())); } - @Override + @EventHandler(priority= EventPriority.MONITOR) public void onPlayerQuit(final PlayerQuitEvent event) { final User user = ess.getUser(event.getPlayer()); -- cgit v1.2.3 From e46fe381b4610d6a784922fe0bfc1bdca963d7c3 Mon Sep 17 00:00:00 2001 From: snowleo Date: Fri, 20 Jan 2012 05:52:35 +0100 Subject: Removing load info, bucket displays that now. --- EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java | 4 ---- 1 file changed, 4 deletions(-) (limited to 'EssentialsXMPP/src/com/earth2me') diff --git a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java index 65925c00a..b5c011e55 100644 --- a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java +++ b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java @@ -10,8 +10,6 @@ import java.util.logging.Logger; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import org.bukkit.event.Event.Priority; -import org.bukkit.event.Event.Type; import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.java.JavaPlugin; @@ -54,8 +52,6 @@ public class EssentialsXMPP extends JavaPlugin implements IEssentialsXMPP ess.addReloadListener(users); ess.addReloadListener(xmpp); - - LOGGER.info(_("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), "essentials team")); } @Override -- cgit v1.2.3