diff --git a/src/main/java/us/camin/JoinListener.java b/src/main/java/us/camin/JoinListener.java index 1816a4a..4331efa 100644 --- a/src/main/java/us/camin/JoinListener.java +++ b/src/main/java/us/camin/JoinListener.java @@ -29,7 +29,8 @@ import java.util.logging.Logger; import java.util.Scanner; import org.bukkit.entity.Player; -import org.bukkit.event.player.PlayerListener; +import org.bukkit.event.Listener; +import org.bukkit.event.EventHandler; import org.bukkit.event.player.PlayerLoginEvent; import org.bukkit.event.player.PlayerJoinEvent; @@ -37,7 +38,7 @@ import org.json.JSONArray; import org.json.JSONObject; import org.json.JSONException; -public class JoinListener extends PlayerListener { +public class JoinListener implements Listener { Logger log = Logger.getLogger("Caminus.Join"); private String m_url; @@ -48,6 +49,8 @@ public class JoinListener extends PlayerListener { m_url = url; } + + @EventHandler public void onPlayerLogin(PlayerLoginEvent event) { Player p = event.getPlayer(); if (p.hasPermission("caminus.whitelisted")) @@ -65,6 +68,7 @@ public class JoinListener extends PlayerListener { } } + @EventHandler public void onPlayerJoin(PlayerJoinEvent event) { Player p = event.getPlayer(); String[] motd = null; diff --git a/src/main/java/us/camin/Plugin.java b/src/main/java/us/camin/Plugin.java index c4e285f..00b8985 100644 --- a/src/main/java/us/camin/Plugin.java +++ b/src/main/java/us/camin/Plugin.java @@ -43,7 +43,6 @@ public class Plugin extends JavaPlugin { conf.addDefault("url", "http://camin.us/api/"); String url = conf.getString("url"); m_listener.setURL(url); - pm.registerEvent(Event.Type.PLAYER_LOGIN, m_listener, Event.Priority.Normal, this); - pm.registerEvent(Event.Type.PLAYER_JOIN, m_listener, Event.Priority.Normal, this); + pm.registerEvents(m_listener, this); } }