mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-26 20:55:44 +01:00
Update passenger yaw in navigation (issue #994)
This commit is contained in:
parent
3634bce18e
commit
e68e9ad5c6
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user