Skip to content

Commit

Permalink
Set handle.ax for head yaw
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Mar 12, 2013
1 parent 6b41334 commit 30a31bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/main/java/net/citizensnpcs/util/NMS.java
Expand Up @@ -16,6 +16,7 @@
import net.minecraft.server.v1_4_R1.DamageSource;
import net.minecraft.server.v1_4_R1.EnchantmentManager;
import net.minecraft.server.v1_4_R1.Entity;
import net.minecraft.server.v1_4_R1.EntityHuman;
import net.minecraft.server.v1_4_R1.EntityLiving;
import net.minecraft.server.v1_4_R1.EntityMonster;
import net.minecraft.server.v1_4_R1.EntityPlayer;
Expand Down Expand Up @@ -267,6 +268,8 @@ public static void setHeadYaw(EntityLiving handle, float yaw) {
yaw -= 360.0F;
}
handle.az = yaw;
if (!(handle instanceof EntityHuman))
handle.ax = yaw;
handle.aA = yaw;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/citizensnpcs/util/Util.java
Expand Up @@ -47,9 +47,9 @@ public static NPCPushEvent callPushEvent(NPC npc, Vector vector) {
public static void faceEntity(LivingEntity from, LivingEntity at) {
if (from.getWorld() != at.getWorld())
return;
double xDiff, yDiff, zDiff;
Location atLocation = at.getLocation(AT_LOCATION);
Location fromLocation = from.getLocation(FROM_LOCATION);
double xDiff, yDiff, zDiff;
xDiff = atLocation.getX() - fromLocation.getX();
yDiff = atLocation.getY() - fromLocation.getY();
zDiff = atLocation.getZ() - fromLocation.getZ();
Expand Down

0 comments on commit 30a31bd

Please sign in to comment.