Set the last location at the end of refreshPosition

This commit is contained in:
Tyan 2021-01-23 15:43:06 +01:00
parent 09d8f74b07
commit 7d7c65aa70

View File

@ -151,6 +151,9 @@ public abstract class Entity implements Viewable, EventHandler, DataContainer, P
this.entityType = entityType;
this.uuid = uuid;
this.position = spawnPosition.clone();
this.lastX = spawnPosition.getX();
this.lastY = spawnPosition.getY();
this.lastZ = spawnPosition.getZ();
setBoundingBox(0, 0, 0);
@ -1100,9 +1103,6 @@ public abstract class Entity implements Viewable, EventHandler, DataContainer, P
* @param z new position Z
*/
public void refreshPosition(float x, float y, float z) {
this.lastX = position.getX();
this.lastY = position.getY();
this.lastZ = position.getZ();
position.setX(x);
position.setY(y);
position.setZ(z);
@ -1139,6 +1139,10 @@ public abstract class Entity implements Viewable, EventHandler, DataContainer, P
}
}
}
this.lastX = position.getX();
this.lastY = position.getY();
this.lastZ = position.getZ();
}
/**