From 550dfbd6a283341de5b60e89f6e3cd12e66d011f Mon Sep 17 00:00:00 2001 From: fullwall Date: Tue, 19 Feb 2013 10:32:33 +0800 Subject: [PATCH] Possible fix, pt. 2 --- .../java/net/citizensnpcs/npc/entity/EntityHumanNPC.java | 4 ++++ src/main/java/net/citizensnpcs/util/NMS.java | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/citizensnpcs/npc/entity/EntityHumanNPC.java b/src/main/java/net/citizensnpcs/npc/entity/EntityHumanNPC.java index 34c0ff71e..a7b2261c9 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/EntityHumanNPC.java +++ b/src/main/java/net/citizensnpcs/npc/entity/EntityHumanNPC.java @@ -16,9 +16,11 @@ import net.citizensnpcs.util.Util; import net.minecraft.server.v1_4_R1.Connection; import net.minecraft.server.v1_4_R1.EntityPlayer; import net.minecraft.server.v1_4_R1.EnumGamemode; +import net.minecraft.server.v1_4_R1.MathHelper; import net.minecraft.server.v1_4_R1.MinecraftServer; import net.minecraft.server.v1_4_R1.Navigation; import net.minecraft.server.v1_4_R1.NetworkManager; +import net.minecraft.server.v1_4_R1.Packet35EntityHeadRotation; import net.minecraft.server.v1_4_R1.Packet5EntityEquipment; import net.minecraft.server.v1_4_R1.PlayerInteractManager; import net.minecraft.server.v1_4_R1.World; @@ -126,6 +128,8 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder { super.j_(); if (npc == null) return; + int i = MathHelper.d(az * 256.0F / 360.0F); + NMS.sendToOnline(new Packet35EntityHeadRotation(id, (byte) i)); if (getBukkitEntity() != null && Util.isLoaded(getBukkitEntity().getLocation(LOADED_LOCATION))) { if (!npc.getNavigator().isNavigating() && !NMS.inWater(getBukkitEntity())) move(0, -0.2, 0); diff --git a/src/main/java/net/citizensnpcs/util/NMS.java b/src/main/java/net/citizensnpcs/util/NMS.java index 15f85aaf4..040405a47 100644 --- a/src/main/java/net/citizensnpcs/util/NMS.java +++ b/src/main/java/net/citizensnpcs/util/NMS.java @@ -24,7 +24,6 @@ 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; @@ -263,10 +262,6 @@ public class NMS { } 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) {