[PR #6666] [MERGED] Preserve server-forced flight when flight toggling is disabled #7022

Closed
opened 2026-11-03 06:32:17 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6666
Author: @xMelonekMaX
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: fix/server-forced-flight


📝 Commits (2)

  • 53ba4b5 fix: preserve server-forced flight without toggle permission
  • b440c53 Merge origin/main into fix/server-forced-flight

📊 Changes

4 files changed (+97 additions, -8 deletions)

View changed files

📝 crates/horizon-client/examples/probe/scene_motion_probe.rs (+3 -0)
📝 crates/horizon-client/src/motion.rs (+57 -3)
📝 mods/horizon/src/test/java/dev/horizonlab/parity/VanillaSceneMotionOracle.java (+1 -1)
📝 tools/test_native_scene_motion.py (+36 -4)

📄 Description

🤖 Opened by xMelonekMaX's AI agent (Codex, GPT-6), not by xMelonekMaX personally.

What and why

Reproduction server: benchmark.ogulniega.com.

On joining this server in Adventure mode, vanilla keeps the player stationary in midair and prevents the normal flight-toggle input. Affected Horizon clears flight and the player falls into the void.

The server plugin first enables flight, then sends a player-abilities packet with flying=true, mayfly=false and flying speed 0.0. The combination is intentional: the server forces flying without granting permission to toggle it, while zero speed prevents movement.

Horizon cleared flying on each movement tick whenever may_fly was false. Make that flag gate the local double-tap flight toggle without clearing the independent server-supplied flying state. An explicit subsequent abilities update setting flying=false still ends flight.

The contributor manually confirmed the original corrected client on benchmark.ogulniega.com (Fedora 44). This PR contains only the flight correction and its tests, independently of the book and dialog changes.

Fixes #6663

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

Inspected the pinned Minecraft Java Edition 26.3 client jar with javap -p -c:

  • ClientPacketListener.handlePlayerAbilities: flying and permission-to-fly are independent bits. Horizon already decoded and applied them independently.
  • LocalPlayer.aiStep: Abilities.mayfly guards the local flight-toggle logic; it does not clear Abilities.flying solely because mayfly is false.
  • Player.aiStep, Player.travel and Player.getFlyingSpeed: retain and apply the supplied flying state and speed.

Extended the existing tools/test_native_scene_motion.py, Java oracle and Rust probe with eight scenes. They cover independent flying/mayfly states, zero/default flying speed, idle/forward input, and an explicit update ending flight. The cases remain in the default corpus; --flight-only runs them separately, and --no-default-features permits building without audio/controllers. After the upstream crate split, the harness builds horizon-client-lib's client_probe.

The differential scene comparison exercises resident Player movement against the real pinned client and server jars. It does not exercise live packet ordering or the entire LocalPlayer tick. The controlled-input regression additionally drives local jump/sneak/directional input, and the original multiplayer correction was checked manually by the contributor.

Other projects' code

none

Verification

Current validation on b440c53ce, after merging main 81e528f92:

  • All 39 horizon-client-lib motion tests pass with prepared resources present, including server_forced_flight_survives_without_permission_to_toggle_it.
  • tools/test_native_scene_motion.py --flight-only --no-default-features: all eight scenes / 344 operations match both pinned vanilla jars (2,760 output lines per jar).
  • Focused Clippy for horizon-client-lib --lib --example client_probe --no-default-features, with warnings denied, passes using a consistent toolchain and separate cache.
  • The fast game/control-tool build with --no-default-features passes.
  • The current self-check passes all 598 Python tests, rustfmt and public-tree checks.

Historical validation of the original correction:

  • The controlled-input regression fails before the correction on tick 0, because server-forced flight is immediately cleared.
  • All 39 motion tests pass with prepared resources. The regression covers 60 ticks of zero-speed flight under directional/jump/sneak input and falling after an explicit server update ends flight.
  • All eight flight scenes / 344 operations match both pinned vanilla jars (2,760 output lines each).
  • Existing player_travel and living_motion parity harnesses pass.
  • The contributor confirmed the original correction on benchmark.ogulniega.com.

The original full resident scene run had a separate negative fall-damage mismatch in the armor/armor_toughness attribute-cache dirty flags. An isolated reproduction using only three attribute assignments, a health assignment and hurt(-1) reproduced it without any movement or abilities operation. This PR does not change that path. No existing cases were removed or weakened. The full resident scene corpus and full affected parity matrix have not been rerun during this preparation.

Self-check

pr_ready (tools/pr_ready.py --quick on 192, against origin/main at 81e528f92, 1 min 43 s)

Check Result
Scope ✅ 6 files, +100 −8
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 598 passed (1 min 6 s)
rustfmt ✅ (17 s)
clippy ❌ failed (9 s)
tests: horizon-client-lib ❌ failed (6 s)
doc tests ❌ failed (3 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 374 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, armor_stand_frost, arrow, arrow_wind_charge, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes and 362 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

This is not a clean full self-check. All 598 Python tests, rustfmt and public-tree checks pass on the updated base. The default-feature Rust checks need missing ALSA development metadata (alsa.pc), and the runner's Clippy encounters incompatible cached Rust dependencies (E0514). Focused Clippy passes with --no-default-features, a consistent toolchain and a separate target cache. The 374 affected parity harnesses were listed, not run.

The runner counted two unrelated untracked text files; neither is included in this PR. The actual diff contains four files, +97/−8, against main 81e528f92. The eight forced-flight scenes were run separately against both pinned vanilla jars after the merge and pass; this is not a claim that the full resident scene corpus or affected parity matrix passes.

Screenshots

No screenshots included: this correction concerns movement over time rather than a static rendering change. The reproduction server is benchmark.ogulniega.com; the original correction was manually confirmed there, and the tests check position, velocity and flying state. A short before/after recording can be supplied separately if requested.

🤖 Generated with Codex


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/6666 **Author:** [@xMelonekMaX](https://github.com/xMelonekMaX) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/server-forced-flight` --- ### 📝 Commits (2) - [`53ba4b5`](https://github.com/horizon-rust/horizon/commit/53ba4b5a0a370e422627c29b2a23c3ff890601dc) fix: preserve server-forced flight without toggle permission - [`b440c53`](https://github.com/horizon-rust/horizon/commit/b440c53cee2a02c7f2a6e8bb2074bdf7f5f40c54) Merge origin/main into fix/server-forced-flight ### 📊 Changes **4 files changed** (+97 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/examples/probe/scene_motion_probe.rs` (+3 -0) 📝 `crates/horizon-client/src/motion.rs` (+57 -3) 📝 `mods/horizon/src/test/java/dev/horizonlab/parity/VanillaSceneMotionOracle.java` (+1 -1) 📝 `tools/test_native_scene_motion.py` (+36 -4) </details> ### 📄 Description > 🤖 Opened by xMelonekMaX's AI agent (Codex, GPT-6), not by xMelonekMaX personally. ## What and why Reproduction server: **`benchmark.ogulniega.com`**. On joining this server in Adventure mode, vanilla keeps the player stationary in midair and prevents the normal flight-toggle input. Affected Horizon clears flight and the player falls into the void. The server plugin first enables flight, then sends a player-abilities packet with `flying=true`, `mayfly=false` and flying speed `0.0`. The combination is intentional: the server forces flying without granting permission to toggle it, while zero speed prevents movement. Horizon cleared `flying` on each movement tick whenever `may_fly` was false. Make that flag gate the local double-tap flight toggle without clearing the independent server-supplied flying state. An explicit subsequent abilities update setting `flying=false` still ends flight. The contributor manually confirmed the original corrected client on `benchmark.ogulniega.com` (Fedora 44). This PR contains only the flight correction and its tests, independently of the book and dialog changes. Fixes #6663 ## Kind - [x] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference Inspected the pinned Minecraft Java Edition 26.3 client jar with `javap -p -c`: - `ClientPacketListener.handlePlayerAbilities`: flying and permission-to-fly are independent bits. Horizon already decoded and applied them independently. - `LocalPlayer.aiStep`: `Abilities.mayfly` guards the local flight-toggle logic; it does not clear `Abilities.flying` solely because `mayfly` is false. - `Player.aiStep`, `Player.travel` and `Player.getFlyingSpeed`: retain and apply the supplied flying state and speed. Extended the existing `tools/test_native_scene_motion.py`, Java oracle and Rust probe with eight scenes. They cover independent flying/mayfly states, zero/default flying speed, idle/forward input, and an explicit update ending flight. The cases remain in the default corpus; `--flight-only` runs them separately, and `--no-default-features` permits building without audio/controllers. After the upstream crate split, the harness builds `horizon-client-lib`'s `client_probe`. The differential scene comparison exercises resident `Player` movement against the real pinned client and server jars. It does not exercise live packet ordering or the entire `LocalPlayer` tick. The controlled-input regression additionally drives local jump/sneak/directional input, and the original multiplayer correction was checked manually by the contributor. ## Other projects' code none ## Verification Current validation on `b440c53ce`, after merging main `81e528f92`: - All 39 `horizon-client-lib` motion tests pass with prepared resources present, including `server_forced_flight_survives_without_permission_to_toggle_it`. - `tools/test_native_scene_motion.py --flight-only --no-default-features`: all eight scenes / 344 operations match both pinned vanilla jars (2,760 output lines per jar). - Focused Clippy for `horizon-client-lib --lib --example client_probe --no-default-features`, with warnings denied, passes using a consistent toolchain and separate cache. - The fast game/control-tool build with `--no-default-features` passes. - The current self-check passes all 598 Python tests, rustfmt and public-tree checks. Historical validation of the original correction: - The controlled-input regression fails before the correction on tick 0, because server-forced flight is immediately cleared. - All 39 motion tests pass with prepared resources. The regression covers 60 ticks of zero-speed flight under directional/jump/sneak input and falling after an explicit server update ends flight. - All eight flight scenes / 344 operations match both pinned vanilla jars (2,760 output lines each). - Existing `player_travel` and `living_motion` parity harnesses pass. - The contributor confirmed the original correction on `benchmark.ogulniega.com`. The original full resident scene run had a separate negative fall-damage mismatch in the `armor`/`armor_toughness` attribute-cache dirty flags. An isolated reproduction using only three attribute assignments, a health assignment and `hurt(-1)` reproduced it without any movement or abilities operation. This PR does not change that path. No existing cases were removed or weakened. The full resident scene corpus and full affected parity matrix have not been rerun during this preparation. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on 192, against origin/main at 81e528f92, 1 min 43 s) | Check | Result | | --- | --- | | Scope | ✅ 6 files, +100 −8 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 598 passed (1 min 6 s) | | rustfmt | ✅ (17 s) | | clippy | ❌ failed (9 s) | | tests: horizon-client-lib | ❌ failed (6 s) | | doc tests | ❌ failed (3 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 374 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, armor_stand_frost, arrow, arrow_wind_charge, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes and 362 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | This is not a clean full self-check. All 598 Python tests, rustfmt and public-tree checks pass on the updated base. The default-feature Rust checks need missing ALSA development metadata (`alsa.pc`), and the runner's Clippy encounters incompatible cached Rust dependencies (E0514). Focused Clippy passes with `--no-default-features`, a consistent toolchain and a separate target cache. The 374 affected parity harnesses were listed, not run. The runner counted two unrelated untracked text files; neither is included in this PR. The actual diff contains four files, +97/−8, against main `81e528f92`. The eight forced-flight scenes were run separately against both pinned vanilla jars after the merge and pass; this is not a claim that the full resident scene corpus or affected parity matrix passes. ## Screenshots No screenshots included: this correction concerns movement over time rather than a static rendering change. The reproduction server is `benchmark.ogulniega.com`; the original correction was manually confirmed there, and the tests check position, velocity and flying state. A short before/after recording can be supplied separately if requested. 🤖 Generated with [Codex](https://openai.com/codex/) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:32:17 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#7022
No description provided.