Update passenger yaw in navigation (issue #994)

This commit is contained in:
fullwall 2016-12-02 20:08:56 +08:00
parent 3634bce18e
commit e68e9ad5c6
1 changed files with 8 additions and 0 deletions

View File

@ -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;