From 57d31f1940a069e7f483606e271a0ca48437b2af Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Thu, 10 Mar 2011 05:37:12 +1100 Subject: [PATCH] Implemented LivingEntity.getEyeLocation() By: Andrew Ardill --- .../org/bukkit/craftbukkit/entity/CraftLivingEntity.java | 8 ++++++++ 1 file changed, 8 insertions(+) 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 c6e478f9e5..51a6c91b48 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 @@ -6,6 +6,8 @@ import net.minecraft.server.EntityArrow; import net.minecraft.server.EntityEgg; import net.minecraft.server.EntityLiving; import net.minecraft.server.EntitySnowball; + +import org.bukkit.Location; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftWorld; @@ -171,4 +173,10 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { public void damage(int amount, org.bukkit.entity.Entity source) { entity.a(((CraftEntity)source).getHandle(), amount); } + + public Location getEyeLocation() { + Location loc = getLocation(); + loc.setY(loc.getY() + getEyeHeight()); + return loc; + } }