From e68e9ad5c68cbbea945545033ab2b39730cb16ee Mon Sep 17 00:00:00 2001 From: fullwall Date: Fri, 2 Dec 2016 20:08:56 +0800 Subject: [PATCH] Update passenger yaw in navigation (issue #994) --- .../java/net/citizensnpcs/npc/ai/CitizensNavigator.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main/src/main/java/net/citizensnpcs/npc/ai/CitizensNavigator.java b/main/src/main/java/net/citizensnpcs/npc/ai/CitizensNavigator.java index 7030951ad..f734566ba 100644 --- a/main/src/main/java/net/citizensnpcs/npc/ai/CitizensNavigator.java +++ b/main/src/main/java/net/citizensnpcs/npc/ai/CitizensNavigator.java @@ -163,6 +163,14 @@ public class CitizensNavigator implements Navigator, Runnable { boolean finished = executing.update(); if (localParams.lookAtFunction() != null) { Util.faceLocation(npc.getEntity(), localParams.lookAtFunction().apply(this), true); + Entity entity = npc.getEntity().getPassenger(); + Location npcLoc = npc.getEntity().getLocation(); + while (entity != null) { + Location loc = entity.getLocation(STATIONARY_LOCATION); + loc.setYaw(npcLoc.getYaw()); + entity.teleport(loc); + entity = entity.getPassenger(); + } } if (!finished) { return;