From 9680b8dcdbe4a85bd7c13647de8aaa736782c946 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot 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. By: Roger Baumgartner --- .../java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java index f20c664fd1..83e0ee9d75 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/paper-server/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() {