From 2e7f66787dd01e1a5ddaec37c75b54f0f1ee2ce1 Mon Sep 17 00:00:00 2001 From: Roger Baumgartner Date: Sat, 17 Aug 2013 16:13:31 +0200 Subject: [PATCH] Return correct hasLineOfSight value for players. Fixes BUKKIT-4634 Prior to this change when a plugin called Player.hasLineOfSite() the method would always return false because EntityHuman does not extend EntityInsentient. This commit changes that by explicitly checking for line of sight between two entities and returning that value. --- .../java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java index f20c664fd1..83e0ee9d75 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -329,7 +329,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { } public boolean hasLineOfSight(Entity other) { - return getHandle() instanceof EntityInsentient && ((EntityInsentient) getHandle()).getEntitySenses().canSee(((CraftEntity) other).getHandle()); + return getHandle().o(((CraftEntity) other).getHandle()); } public boolean getRemoveWhenFarAway() {