Try to fix NPC issues

This commit is contained in:
Gabriele C 2015-11-24 23:23:45 +01:00
parent be1eb9392a
commit 2c0d140da9
2 changed files with 3 additions and 3 deletions

View File

@ -220,7 +220,7 @@ public class AuthMePlayerListener implements Listener {
*/
@EventHandler(priority = EventPriority.HIGHEST)
public void onPlayerJoin(PlayerJoinEvent event) {
if (event.getPlayer() == null) {
if (event.getPlayer() == null || Utils.isNPC(event.getPlayer())) {
return;
}
@ -256,7 +256,7 @@ public class AuthMePlayerListener implements Listener {
public void onPreLogin(AsyncPlayerPreLoginEvent event) {
final String name = event.getName().toLowerCase();
final Player player = Utils.getPlayer(name);
if (player == null) {
if (player == null || Utils.isNPC(player)) {
return;
}

View File

@ -128,7 +128,7 @@ public final class Utils {
// TODO: Move to a Manager
public static boolean checkAuth(Player player) {
if (player == null || Utils.isUnrestricted(player)) {
if (player == null || Utils.isUnrestricted(player) || Utils.isNPC(player)) {
return true;
}