Set handle.ax for head yaw

This commit is contained in:
fullwall 2013-03-12 22:49:24 +08:00
parent be24157951
commit 8bf6917fd3
2 changed files with 4 additions and 1 deletions

View File

@ -16,6 +16,7 @@ import net.minecraft.server.v1_4_R1.ControllerLook;
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;
@ -267,6 +268,8 @@ public class NMS {
yaw -= 360.0F;
}
handle.az = yaw;
if (!(handle instanceof EntityHuman))
handle.ax = yaw;
handle.aA = yaw;
}

View File

@ -47,9 +47,9 @@ public class Util {
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();