mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-17 21:51:33 +01:00
Fix passenger position refresh
This commit is contained in:
parent
86376d431e
commit
520c85fcdb
@ -1287,14 +1287,11 @@ public class Entity implements Viewable, Tickable, EventHandler<EntityEvent>, Da
|
||||
*/
|
||||
@ApiStatus.Internal
|
||||
public void refreshPosition(@NotNull final Pos position, boolean ignoreView) {
|
||||
if (!position.samePoint(this.position)) {
|
||||
final var previousPosition = this.position;
|
||||
this.position = ignoreView ? previousPosition.withCoord(position) : position;
|
||||
if (!position.samePoint(previousPosition)) {
|
||||
refreshCoordinate(position);
|
||||
}
|
||||
if (!ignoreView) {
|
||||
this.position = position;
|
||||
} else {
|
||||
this.position = this.position.withCoord(position);
|
||||
}
|
||||
sendPositionUpdate(true);
|
||||
}
|
||||
|
||||
@ -1316,6 +1313,7 @@ public class Entity implements Viewable, Tickable, EventHandler<EntityEvent>, Da
|
||||
private void refreshCoordinate(Point newPosition) {
|
||||
if (hasPassenger()) {
|
||||
for (Entity passenger : getPassengers()) {
|
||||
passenger.position = passenger.position.withCoord(newPosition);
|
||||
passenger.refreshCoordinate(newPosition);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user