[PR #948] [MERGED] Fix spectator scroll wheel flight speed #2933

Closed
opened 2026-11-02 16:00:13 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/948
Author: @rdbtCVS
Created: 10/19/2026
Status: ✅ Merged
Merged: 10/19/2026
Merged by: @ludovic111

Base: main ← Head: t3/fix-issue-945


📝 Commits (1)

  • 0ab07f7 Fix spectator scroll wheel flight speed

📊 Changes

7 files changed (+111 additions, -22 deletions)

View changed files

📝 crates/horizon-client/examples/game_loop_probe.rs (+17 -7)
📝 crates/horizon-client/src/game.rs (+16 -6)
📝 crates/horizon-client/src/game/remote.rs (+6 -1)
📝 crates/horizon-client/src/motion.rs (+47 -3)
📝 crates/horizon-client/src/mouse.rs (+6 -0)
📝 mods/horizon/src/test/java/dev/horizonlab/parity/VanillaGameLoopOracle.java (+9 -2)
📝 tools/test_game_loop_parity.py (+10 -3)

📄 Description

What and why

Fixes #945.

Scrolling vertically in spectator mode now changes the local flight speed by 0.005 per whole wheel step, clamped to 0–0.2, instead of selecting an inventory slot. Horizontal scrolling leaves speed unchanged. Both horizontal flight and jump/descend movement use the stored abilities speed; server abilities updates restore the authoritative value.

Vanilla reference

Follows Minecraft 26.3 MouseHandler.onScroll, Abilities.getFlyingSpeed/setFlyingSpeed, Player.getFlyingSpeed, and the vertical flight calculation in LocalPlayer.aiStep. Inspected MouseHandler.onScroll and Player.getFlyingSpeed with tools/rea_vanilla.py.

Extended tools/test_game_loop_parity.py to exercise the real vanilla scroll handler in spectator mode, including fractional accumulation, discrete scrolling, sensitivity, bounds, recovery from bounds, horizontal-only input, and unchanged inventory selection. All 6,791 cases match the pinned client exactly (84,873 output lines). A movement regression verifies zero speed and proportional horizontal/vertical movement.

Horizon does not currently implement the spectator menu; this fixes the menu-closed behavior.

Self-check

pr_ready (tools/pr_ready.py --quick on archlinux, against origin/main at ba3a0fcf0, 4 min 39 s)

Check Result
Scope ✅ 7 files, +111 −22
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 239 passed (19 s)
rustfmt ✅ (4 s)
clippy ✅ (20 s)
tests: horizon-client ✅ 994 passed (3 min 53 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 275 affected, to run in CI (--quick): ambient_sound, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo, basic_feature, biome_chunk, biome_generation and 263 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Additionally: python3 tools/test_game_loop_parity.py passed all 6,791 cases (84,873 output lines). The broader affected parity suite is left to CI.


🔄 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/948 **Author:** [@rdbtCVS](https://github.com/rdbtCVS) **Created:** 10/19/2026 **Status:** ✅ Merged **Merged:** 10/19/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `t3/fix-issue-945` --- ### 📝 Commits (1) - [`0ab07f7`](https://github.com/horizon-rust/horizon/commit/0ab07f720967092847a487a70052dc8a53fed497) Fix spectator scroll wheel flight speed ### 📊 Changes **7 files changed** (+111 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/examples/game_loop_probe.rs` (+17 -7) 📝 `crates/horizon-client/src/game.rs` (+16 -6) 📝 `crates/horizon-client/src/game/remote.rs` (+6 -1) 📝 `crates/horizon-client/src/motion.rs` (+47 -3) 📝 `crates/horizon-client/src/mouse.rs` (+6 -0) 📝 `mods/horizon/src/test/java/dev/horizonlab/parity/VanillaGameLoopOracle.java` (+9 -2) 📝 `tools/test_game_loop_parity.py` (+10 -3) </details> ### 📄 Description ## What and why Fixes #945. Scrolling vertically in spectator mode now changes the local flight speed by 0.005 per whole wheel step, clamped to 0–0.2, instead of selecting an inventory slot. Horizontal scrolling leaves speed unchanged. Both horizontal flight and jump/descend movement use the stored abilities speed; server abilities updates restore the authoritative value. ## Vanilla reference Follows Minecraft 26.3 `MouseHandler.onScroll`, `Abilities.getFlyingSpeed/setFlyingSpeed`, `Player.getFlyingSpeed`, and the vertical flight calculation in `LocalPlayer.aiStep`. Inspected `MouseHandler.onScroll` and `Player.getFlyingSpeed` with `tools/rea_vanilla.py`. Extended `tools/test_game_loop_parity.py` to exercise the real vanilla scroll handler in spectator mode, including fractional accumulation, discrete scrolling, sensitivity, bounds, recovery from bounds, horizontal-only input, and unchanged inventory selection. All 6,791 cases match the pinned client exactly (84,873 output lines). A movement regression verifies zero speed and proportional horizontal/vertical movement. Horizon does not currently implement the spectator menu; this fixes the menu-closed behavior. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on archlinux, against origin/main at ba3a0fcf0, 4 min 39 s) | Check | Result | | --- | --- | | Scope | ✅ 7 files, +111 −22 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 239 passed (19 s) | | rustfmt | ✅ (4 s) | | clippy | ✅ (20 s) | | tests: horizon-client | ✅ 994 passed (3 min 53 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 275 affected, to run in CI (--quick): ambient_sound, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo, basic_feature, biome_chunk, biome_generation and 263 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | Additionally: `python3 tools/test_game_loop_parity.py` passed all 6,791 cases (84,873 output lines). The broader affected parity suite is left to CI. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 16:00:13 +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#2933
No description provided.