Use NMS#look instead of teleporting to set pitch

This commit is contained in:
fullwall 2019-07-14 00:24:14 +08:00
parent 7a52682b87
commit 68e9ca68b5

View File

@ -283,9 +283,8 @@ public class CitizensNavigator implements Navigator, Runnable {
velocity.setX(0).setY(0).setZ(0); velocity.setX(0).setY(0).setZ(0);
npc.getEntity().setVelocity(velocity); npc.getEntity().setVelocity(velocity);
} }
Location pitch = npc.getEntity().getLocation(); Location loc = npc.getEntity().getLocation(STATIONARY_LOCATION);
pitch.setPitch(0); NMS.look(npc.getEntity(), loc.getYaw(), 0);
npc.getEntity().teleport(pitch);
} }
private void stopNavigating(CancelReason reason) { private void stopNavigating(CancelReason reason) {