mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-01-03 22:08:28 +00:00
Updated for bukkit 600+
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1039 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
parent
c0ab3e290e
commit
825ad4edfc
1 changed files with 15 additions and 23 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue