diff options
author | feildmaster <admin@feildmaster.com> | 2012-04-16 10:31:57 -0500 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2012-06-03 05:34:58 -0500 |
commit | f15785669aefc6c19b7d67f207faa7062f2919e6 (patch) | |
tree | 0499650c7f260f6bca1f6adb3a4ead830477b648 /src/main/java | |
parent | e5200322051f0a4905012b08474b9225585f3e12 (diff) | |
download | craftbukkit-f15785669aefc6c19b7d67f207faa7062f2919e6.tar craftbukkit-f15785669aefc6c19b7d67f207faa7062f2919e6.tar.gz craftbukkit-f15785669aefc6c19b7d67f207faa7062f2919e6.tar.lz craftbukkit-f15785669aefc6c19b7d67f207faa7062f2919e6.tar.xz craftbukkit-f15785669aefc6c19b7d67f207faa7062f2919e6.zip |
Launch fireballs at eye location. Fixes BUKKIT-1155
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java | 6 |
1 files changed, 4 insertions, 2 deletions
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()); } |