player null checks
This commit is contained in:
@@ -177,6 +177,7 @@ public abstract class NPCBase implements NPC, NPCPacketHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isShown(Player player) {
|
public boolean isShown(Player player) {
|
||||||
|
if (player == null) return false;
|
||||||
return shown.contains(player.getUniqueId()) && !autoHidden.contains(player.getUniqueId());
|
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) {
|
public boolean inRangeOf(Player player) {
|
||||||
|
if (player == null) return false;
|
||||||
if (!player.getWorld().equals(location.getWorld())) {
|
if (!player.getWorld().equals(location.getWorld())) {
|
||||||
// No need to continue our checks, they are in different worlds.
|
// No need to continue our checks, they are in different worlds.
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user