diff options
author | md_5 <git@md-5.net> | 2017-09-28 16:23:14 +1000 |
---|---|---|
committer | md_5 <git@md-5.net> | 2017-09-28 16:23:14 +1000 |
commit | a3b3a421ac4ace7786a5375c4c0b4c39d3d9d0ba (patch) | |
tree | 365f5612c09dc2a96c36271d7d164a248f3adcc5 | |
parent | ee91bce15792ca982f33a05587508b41f0030cbb (diff) | |
download | craftbukkit-a3b3a421ac4ace7786a5375c4c0b4c39d3d9d0ba.tar craftbukkit-a3b3a421ac4ace7786a5375c4c0b4c39d3d9d0ba.tar.gz craftbukkit-a3b3a421ac4ace7786a5375c4c0b4c39d3d9d0ba.tar.lz craftbukkit-a3b3a421ac4ace7786a5375c4c0b4c39d3d9d0ba.tar.xz craftbukkit-a3b3a421ac4ace7786a5375c4c0b4c39d3d9d0ba.zip |
SPIGOT-3565: Head yaw is "more accurate" for living entities
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java index 9ef7686b..36571353 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -217,7 +217,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { } public Location getLocation() { - return new Location(getWorld(), entity.locX, entity.locY, entity.locZ, entity.yaw, entity.pitch); + return new Location(getWorld(), entity.locX, entity.locY, entity.locZ, entity instanceof EntityLiving ? entity.getHeadRotation() : entity.yaw, entity.pitch); } public Location getLocation(Location loc) { @@ -226,7 +226,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { loc.setX(entity.locX); loc.setY(entity.locY); loc.setZ(entity.locZ); - loc.setYaw(entity.yaw); + loc.setYaw(entity instanceof EntityLiving ? entity.getHeadRotation() : entity.yaw); loc.setPitch(entity.pitch); } |