mirror of https://github.com/Minestom/Minestom.git
fix: don't simulate movement if the chunk isn't loaded (#2112)
* fix: don't simulate movement if the chunk isn't loaded * chore: changed wrong thing
This commit is contained in:
parent
3de64aafd8
commit
d0c7d7350e
|
@ -592,8 +592,9 @@ public class Entity implements Viewable, Tickable, Schedulable, Snapshotable, Ev
|
|||
|
||||
boolean entityIsPlayer = this instanceof Player;
|
||||
boolean entityFlying = entityIsPlayer && ((Player) this).isFlying();
|
||||
final Block.Getter chunkCache = new ChunkCache(instance, currentChunk, Block.STONE);
|
||||
PhysicsResult physicsResult = PhysicsUtils.simulateMovement(position, velocity.div(ServerFlag.SERVER_TICKS_PER_SECOND), boundingBox,
|
||||
instance.getWorldBorder(), instance, aerodynamics, hasNoGravity(), hasPhysics, onGround, entityFlying, previousPhysicsResult);
|
||||
instance.getWorldBorder(), chunkCache, aerodynamics, hasNoGravity(), hasPhysics, onGround, entityFlying, previousPhysicsResult);
|
||||
this.previousPhysicsResult = physicsResult;
|
||||
|
||||
Chunk finalChunk = ChunkUtils.retrieve(instance, currentChunk, physicsResult.newPosition());
|
||||
|
|
Loading…
Reference in New Issue