From f15785669aefc6c19b7d67f207faa7062f2919e6 Mon Sep 17 00:00:00 2001 From: feildmaster Date: Mon, 16 Apr 2012 10:31:57 -0500 Subject: Launch fireballs at eye location. Fixes BUKKIT-1155 --- src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java index c00d8d63..45b22ad5 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -276,8 +276,10 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { launch = new EntityFireball(world); } - launch.setPositionRotation(getLocation().getX(), getLocation().getY(), getLocation().getZ(), getLocation().getYaw(), getLocation().getPitch()); - Vector direction = getLocation().getDirection().multiply(10); + Location location = getEyeLocation(); + Vector direction = location.getDirection().multiply(10); + + launch.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); ((EntityFireball) launch).setDirection(direction.getX(), direction.getY(), direction.getZ()); } -- cgit v1.2.3