mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-12 13:44:07 +01:00
Fix NPE in lookclose
This commit is contained in:
parent
48a2763a1b
commit
74839e9843
@ -54,9 +54,11 @@ public class LookClose extends Trait implements Toggleable, CommandConfigurable
|
||||
}
|
||||
|
||||
private boolean canSee(Player player) {
|
||||
if (player == null || !player.isValid())
|
||||
return false;
|
||||
return realisticLooking && npc.getEntity() instanceof LivingEntity
|
||||
? ((LivingEntity) npc.getEntity()).hasLineOfSight(player)
|
||||
: player != null && player.isValid();
|
||||
: false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user