From 6e1b0f70dd614c3abb4b13e61505ebd94352ab91 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 26 Mar 2022 15:42:57 +0100 Subject: [PATCH] Fix last NPC stuff --- src/de/steamwar/lobby/display/NPC.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/de/steamwar/lobby/display/NPC.java b/src/de/steamwar/lobby/display/NPC.java index de0abfc..3d7e058 100644 --- a/src/de/steamwar/lobby/display/NPC.java +++ b/src/de/steamwar/lobby/display/NPC.java @@ -166,18 +166,21 @@ public class NPC { } this.location = location; byte yaw = (byte)(int)(location.getYaw() * 256.0 / 360.0); + byte pitch = (byte)(int)(location.getPitch() * 256.0 / 360.0); headRotationYaw.set(headRotation, yaw); move = movePacketConstructor.invoke(); movePacketEntity.set(move, entityId); movePacketX.set(move, location.getX()); movePacketY.set(move, location.getY()); movePacketZ.set(move, location.getZ()); + movePacketYaw.set(move, yaw); + movePacketPitch.set(move, pitch); + movePacketOnGround.set(move, true); namedSpawnX.set(namedSpawn, location.getX()); namedSpawnY.set(namedSpawn, location.getY()); namedSpawnZ.set(namedSpawn, location.getZ()); - movePacketYaw.set(move, yaw); - movePacketPitch.set(move, (byte)(int)(location.getPitch() * 256.0 / 360.0)); - movePacketOnGround.set(move, true); + namedSpawnYaw.set(namedSpawn, yaw); + namedSpawnPitch.set(namedSpawn, pitch); display.setLocation(location); }