Fix NPE in lookclose

This commit is contained in:
fullwall 2021-04-04 11:31:43 +08:00
parent 48a2763a1b
commit 74839e9843

View File

@ -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;
}
/**