mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-05 18:27:17 +01:00
Add LivingEntity.hasLineOfSight. Addresses BUKKIT-1255
By: TomyLobo <tomylobo@nurfuerspam.de>
This commit is contained in:
parent
d824086eff
commit
23a8e4efe3
2 changed files with 13 additions and 0 deletions
|
@ -269,4 +269,13 @@ public interface LivingEntity extends Entity {
|
|||
* @return A collection of {@link PotionEffect}s
|
||||
*/
|
||||
public Collection<PotionEffect> getActivePotionEffects();
|
||||
|
||||
/**
|
||||
* Checks whether the entity has block line of sight to another.<br />
|
||||
* This uses the same algorithm that hostile mobs use to find the closest player.
|
||||
*
|
||||
* @param other The entity to determine line of sight to.
|
||||
* @return true if there is a line of sight, false if not.
|
||||
*/
|
||||
public boolean hasLineOfSight(Entity other);
|
||||
}
|
||||
|
|
|
@ -756,4 +756,8 @@ public class TestPlayer implements Player {
|
|||
public boolean isBlocking() {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
public boolean hasLineOfSight(Entity other) {
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue