Add LivingEntity.hasLineOfSight. Addresses BUKKIT-1255

By: TomyLobo <tomylobo@nurfuerspam.de>
This commit is contained in:
Bukkit/Spigot 2012-03-21 16:30:35 +01:00
parent d824086eff
commit 23a8e4efe3
2 changed files with 13 additions and 0 deletions

View file

@ -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);
}

View file

@ -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.");
}
}