Possible fix for NPCs looking south

This commit is contained in:
fullwall 2013-02-19 10:25:59 +08:00
parent 6f290d8ea7
commit 1946c1a7db
2 changed files with 12 additions and 1 deletions

View File

@ -126,7 +126,6 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
super.j_();
if (npc == null)
return;
if (getBukkitEntity() != null && Util.isLoaded(getBukkitEntity().getLocation(LOADED_LOCATION))) {
if (!npc.getNavigator().isNavigating() && !NMS.inWater(getBukkitEntity()))
move(0, -0.2, 0);

View File

@ -24,6 +24,7 @@ import net.minecraft.server.v1_4_R1.MobEffectList;
import net.minecraft.server.v1_4_R1.Navigation;
import net.minecraft.server.v1_4_R1.NetworkManager;
import net.minecraft.server.v1_4_R1.Packet;
import net.minecraft.server.v1_4_R1.Packet35EntityHeadRotation;
import net.minecraft.server.v1_4_R1.PathfinderGoalSelector;
import net.minecraft.server.v1_4_R1.World;
@ -253,8 +254,19 @@ public class NMS {
}
public static void setHeadYaw(EntityLiving handle, float yaw) {
while (yaw < -180.0F) {
yaw += 360.0F;
}
while (yaw >= 180.0F) {
yaw -= 360.0F;
}
handle.az = yaw;
handle.aA = yaw;
if (handle instanceof EntityPlayer) {
int i = MathHelper.d(yaw * 256.0F / 360.0F);
sendToOnline(new Packet35EntityHeadRotation(handle.id, (byte) i));
}
}
public static void setLandSpeedModifier(EntityLiving handle, float speed) {