summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzenexer <zenexer@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-03-30 16:40:44 +0000
committerzenexer <zenexer@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-03-30 16:40:44 +0000
commit825ad4edfc00d9339362965b3e8311c6096686c8 (patch)
treea868f8044a13f3b446a5db8b9dfe258c17d4b87d
parentc0ab3e290ef55c1890d716bc9b76ab57dac29155 (diff)
downloadEssentials-825ad4edfc00d9339362965b3e8311c6096686c8.tar
Essentials-825ad4edfc00d9339362965b3e8311c6096686c8.tar.gz
Essentials-825ad4edfc00d9339362965b3e8311c6096686c8.tar.lz
Essentials-825ad4edfc00d9339362965b3e8311c6096686c8.tar.xz
Essentials-825ad4edfc00d9339362965b3e8311c6096686c8.zip
Updated for bukkit 600+
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1039 e251c2fe-e539-e718-e476-b85c1f46cddb
-rw-r--r--Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java38
1 files changed, 15 insertions, 23 deletions
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
index e01f40cb1..f4aad6653 100644
--- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
+++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
@@ -162,18 +162,30 @@ public class EssentialsPlayerListener extends PlayerListener
}
@Override
- public void onPlayerJoin(PlayerEvent event)
+ public void onPlayerLogin(PlayerLoginEvent event)
{
- Essentials.getStatic().backup.onPlayerJoin();
User user = User.get(event.getPlayer());
+ if (event.getResult() != Result.ALLOWED)
+ return;
- //we do not know the ip address on playerlogin so we need to do this here.
+ if (user.isBanned())
+ {
+ event.disallow(Result.KICK_BANNED, "The Ban Hammer has spoken!");
+ return;
+ }
+
if (user.isIpBanned())
{
user.kickPlayer("The Ban Hammer has spoken!");
return;
}
+ if (server.getOnlinePlayers().length >= server.getMaxPlayers() && !user.isOp())
+ {
+ event.disallow(Result.KICK_FULL, "Server is full");
+ return;
+ }
+
user.setDisplayName(user.getNick());
if (!Essentials.getSettings().isCommandDisabled("motd") && user.isAuthorized("essentials.motd"))
@@ -191,26 +203,6 @@ public class EssentialsPlayerListener extends PlayerListener
if (mail.isEmpty()) user.sendMessage("§7You have no new mail.");
else user.sendMessage("§cYou have " + mail.size() + " messages!§f Type §7/mail read§f to view your mail.");
}
- }
-
- @Override
- public void onPlayerLogin(PlayerLoginEvent event)
- {
- User user = User.get(event.getPlayer());
- if (event.getResult() != Result.ALLOWED)
- return;
-
- if (user.isBanned())
- {
- event.disallow(Result.KICK_BANNED, "The Ban Hammer has spoken!");
- return;
- }
-
- if (server.getOnlinePlayers().length >= server.getMaxPlayers() && !user.isOp())
- {
- event.disallow(Result.KICK_FULL, "Server is full");
- return;
- }
updateCompass(user);
}