player null checks

This commit is contained in:
Gatt 2020-07-28 15:23:27 +10:00
parent 8a308a00f9
commit 19f1856f4d
1 changed files with 2 additions and 0 deletions

View File

@ -177,6 +177,7 @@ public abstract class NPCBase implements NPC, NPCPacketHandler {
@Override
public boolean isShown(Player player) {
if (player == null) return false;
return shown.contains(player.getUniqueId()) && !autoHidden.contains(player.getUniqueId());
}
@ -199,6 +200,7 @@ public abstract class NPCBase implements NPC, NPCPacketHandler {
}
public boolean inRangeOf(Player player) {
if (player == null) return false;
if (!player.getWorld().equals(location.getWorld())) {
// No need to continue our checks, they are in different worlds.
return false;