mirror of
https://github.com/Minestom/Minestom.git
synced 2025-03-02 11:21:15 +01:00
Merge pull request #113 from DerTyan/fix-entity-chunk-refresh
Set the last location at the end of refreshPosition and at construction
This commit is contained in:
commit
948ac834bb
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user