From 50cd5576f9fcaedd7373535afa1dbf4f94b6712c Mon Sep 17 00:00:00 2001 From: Kacpherek Date: Tue, 27 Oct 2026 11:06:03 +0100 Subject: [PATCH] Clear a flying player's fall distance on the server tick --- crates/horizon-client/src/game/lan_actions.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/horizon-client/src/game/lan_actions.rs b/crates/horizon-client/src/game/lan_actions.rs index ef177d26d..c7bd59f68 100644 --- a/crates/horizon-client/src/game/lan_actions.rs +++ b/crates/horizon-client/src/game/lan_actions.rs @@ -2211,6 +2211,7 @@ impl Game<'_> { let in_wall = !g.sleeping && self.in_wall(g.position, g.eye_height()); let at = g.position; let (sneaking, sleeping) = (g.sneaking, g.sleeping); + let riding = g.vehicle.is_some(); let mut soul = None; let events = self.as_guest(host, conn, |game| { let (rules, motion) = (game.world.health_rules, game.motion); @@ -2230,6 +2231,12 @@ impl Game<'_> { w.player.health.advance_clock(); let _ = w.fluid_base_tick(); w.player.ground.on_ground = from_ground; + // Player.aiStep: a flying player that isn't riding starts every tick + // with no fall distance, so flying down in creative and switching to + // survival lands without the flight's distance. + if w.player.flying && !riding { + w.player.fall_distance = 0.0; + } let travelled: Vec<[f64; 3]> = moves.iter().map(|m| m.0).collect(); // Entity.move's movementThisTick: each move, from where the // tick's first one started.