mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-23 19:16:34 +01:00
Possible fix for NPCs looking south
This commit is contained in:
parent
6f290d8ea7
commit
1946c1a7db
@ -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);
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user