mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-15 20:23:53 -07:00
Add LivingEntity.hasLineOfSight. Addresses BUKKIT-1255
By: TomyLobo <tomylobo@nurfuerspam.de>
This commit is contained in:
@@ -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.");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user