Skip to content

Commit

Permalink
Set elytra fly acceleration to zero when going into an unloaded chunk…
Browse files Browse the repository at this point in the history
… with "No Unloaded Chunks" enabled (MeteorDevelopment#4906)
  • Loading branch information
spinningtoilet0 authored Oct 7, 2024
1 parent 3e5ae3a commit 37cb315
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ public void handleAcceleration() {
}
}

public void zeroAcceleration() {
acceleration = 0;
}

protected double getSpeed() {
return elytraFly.acceleration.get() ? acceleration : elytraFly.horizontalSpeed.get();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ private void onPlayerMove(PlayerMoveEvent event) {
if (mc.world.getChunkManager().isChunkLoaded(chunkX, chunkZ)) {
if (flightMode.get() != ElytraFlightModes.Bounce) ((IVec3d) event.movement).set(currentMode.velX, currentMode.velY, currentMode.velZ);
} else {
currentMode.zeroAcceleration();
((IVec3d) event.movement).set(0, currentMode.velY, 0);
}
} else if (flightMode.get() != ElytraFlightModes.Bounce) ((IVec3d) event.movement).set(currentMode.velX, currentMode.velY, currentMode.velZ);
Expand Down

0 comments on commit 37cb315

Please sign in to comment.