I think switches are better.

This commit is contained in:
KHobbits 2012-03-03 05:09:03 +00:00
parent de7ab13c03
commit b6bbe237ea

View File

@ -182,10 +182,15 @@ public class EssentialsPlayerListener implements Listener
@EventHandler(priority = EventPriority.HIGH) @EventHandler(priority = EventPriority.HIGH)
public void onPlayerLogin(final PlayerLoginEvent event) public void onPlayerLogin(final PlayerLoginEvent event)
{ {
if (event.getResult() != Result.ALLOWED && event.getResult() != Result.KICK_FULL && event.getResult() != Result.KICK_BANNED) switch (event.getResult()) {
{ case ALLOWED:
return; case KICK_FULL:
case KICK_BANNED:
break;
default:
return;
} }
User user = ess.getUser(event.getPlayer()); User user = ess.getUser(event.getPlayer());
user.setNPC(false); user.setNPC(false);