mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-13 19:51:27 +01:00
Small velocity code cleanup
This commit is contained in:
parent
fc694f4b49
commit
c5d56ae820
@ -489,9 +489,6 @@ public abstract class Entity implements Viewable, EventHandler, DataContainer, P
|
||||
|
||||
this.onGround = CollisionUtils.handlePhysics(this, deltaPos, newPosition, newVelocityOut);
|
||||
|
||||
// Stop here if the position is the same
|
||||
final boolean updatePosition = !newPosition.isSimilar(position);
|
||||
|
||||
// World border collision
|
||||
final Position finalVelocityPosition = CollisionUtils.applyWorldBorder(instance, position, newPosition);
|
||||
final Chunk finalChunk = instance.getChunkAt(finalVelocityPosition);
|
||||
@ -501,8 +498,8 @@ public abstract class Entity implements Viewable, EventHandler, DataContainer, P
|
||||
return;
|
||||
}
|
||||
|
||||
// Apply the position
|
||||
if (updatePosition) {
|
||||
// Apply the position if changed
|
||||
if (!newPosition.isSimilar(position)) {
|
||||
refreshPosition(finalVelocityPosition);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user