summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorTomyLobo <tomylobo@nurfuerspam.de>2012-03-21 16:30:35 +0100
committerfeildmaster <admin@feildmaster.com>2012-06-23 10:58:01 -0500
commitd3bf76da9de67e7cd6e97d80086f2aa907930fb7 (patch)
treea39f3d72588c8da4cd04fc18c2fec907a5b6b178 /src/main
parentf735129254e7cd2e7bfdf05923885dd0e001cbac (diff)
downloadbukkit-d3bf76da9de67e7cd6e97d80086f2aa907930fb7.tar
bukkit-d3bf76da9de67e7cd6e97d80086f2aa907930fb7.tar.gz
bukkit-d3bf76da9de67e7cd6e97d80086f2aa907930fb7.tar.lz
bukkit-d3bf76da9de67e7cd6e97d80086f2aa907930fb7.tar.xz
bukkit-d3bf76da9de67e7cd6e97d80086f2aa907930fb7.zip
Add LivingEntity.hasLineOfSight. Addresses BUKKIT-1255
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/bukkit/entity/LivingEntity.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 6787d79a..e93453a3 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -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);
}