mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-27 13:06:02 +01:00
Return correct hasLineOfSight value for players. Fixes BUKKIT-4634
Prior to this change when a plugin called Player.hasLineOfSite() the method would always return false because EntityHuman does not extend EntityInsentient. This commit changes that by explicitly checking for line of sight between two entities and returning that value.
This commit is contained in:
parent
6482b6f0bd
commit
2e7f66787d
@ -329,7 +329,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasLineOfSight(Entity other) {
|
public boolean hasLineOfSight(Entity other) {
|
||||||
return getHandle() instanceof EntityInsentient && ((EntityInsentient) getHandle()).getEntitySenses().canSee(((CraftEntity) other).getHandle());
|
return getHandle().o(((CraftEntity) other).getHandle());
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getRemoveWhenFarAway() {
|
public boolean getRemoveWhenFarAway() {
|
||||||
|
Loading…
Reference in New Issue
Block a user