diff options
author | TomyLobo <tomylobo@nurfuerspam.de> | 2012-03-21 16:31:30 +0100 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2012-06-23 10:48:08 -0500 |
commit | 412b7eaa12f2ea3dd8b2e8f114aff5e543b0cf73 (patch) | |
tree | afe095095e8ca03259284875ed39a703592ac91a /src/main | |
parent | 78acee359e4d26059e76b96c65fc84f1fb2fe868 (diff) | |
download | craftbukkit-412b7eaa12f2ea3dd8b2e8f114aff5e543b0cf73.tar craftbukkit-412b7eaa12f2ea3dd8b2e8f114aff5e543b0cf73.tar.gz craftbukkit-412b7eaa12f2ea3dd8b2e8f114aff5e543b0cf73.tar.lz craftbukkit-412b7eaa12f2ea3dd8b2e8f114aff5e543b0cf73.tar.xz craftbukkit-412b7eaa12f2ea3dd8b2e8f114aff5e543b0cf73.zip |
Implement LivingEntity.hasLineOfSight. Addresses BUKKIT-1255
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java index 45b22ad5..b9a2cd7d 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -25,6 +25,7 @@ import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.entity.Arrow; import org.bukkit.entity.Egg; +import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.HumanEntity; import org.bukkit.entity.EnderPearl; @@ -292,4 +293,8 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { public EntityType getType() { return EntityType.UNKNOWN; } + + public boolean hasLineOfSight(Entity other) { + return getHandle().am().canSee(((CraftEntity) other).getHandle()); // am should be getEntitySenses + } } |