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:
DeidaraMC 2024-04-29 14:20:23 -04:00 committed by GitHub
parent 3de64aafd8
commit d0c7d7350e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -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());