[PR #5868] [MERGED] Preserve wind charge momentum across queued player movement #6527

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5868
Author: @oskal675-design
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/gliding-explosion-impulse


📝 Commits (1)

  • 7b2497f Keep item use ahead of later player movement

📊 Changes

4 files changed (+147 additions, -6 deletions)

View changed files

📝 crates/horizon-client/src/lan/hub.rs (+8 -0)
📝 mods/horizon/src/test/java/dev/horizonlab/parity/KnockbackClient.java (+41 -6)
📝 tests/test_game_home.py (+1 -0)
➕ tools/test_item_use_order_parity.py (+97 -0)

📄 Description

🤖 Opened by oskal675-design's AI agent (Codex, GPT-6.1), not by oskal675-design personally.

What and why

Fixes #5828.

A queued UseItem was handed to the game after the hub had already processed subsequent movement packets. A wind charge could therefore launch from the later position and inherit the later movement. During an elytra boost it could burst ahead of the player and remove forward momentum.

Keep a later move queued until the item use has run, using the same barrier already applied to block uses and entity interactions. The gameplay change is eight lines in Hub::process_inbox.

Add a real-server differential test: a vanilla-codec client batches an item use and a subsequent eight-block move into one network write. In both standing and gliding poses, the charge must originate at the old position with the old movement. The Java client records spawn X by block and velocity X rounded to a block/tick to separate this ordering error from random throw inaccuracy. The harness also confirms both servers actually started gliding. Its servers use the existing scratch-home Server helper; the home-safety test explicitly records that delegation.

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

Minecraft Java 26.3 ServerGamePacketListenerImpl.handleUseItem uses the player's state when that packet runs; a subsequent handleMovePlayer updates it afterwards. WindChargeItem.use creates the charge at the player's current position, and Projectile.shootFromRotation adds ServerPlayer.getKnownMovement. Read those methods from the pinned vanilla jar.

tools/test_item_use_order_parity.py checks that ordering against an actual vanilla dedicated server using vanilla's packet codecs. tools/port_ledger.py check --base origin/main reports no new gaps for this change.

Other projects' code

none

Self-check

  • python3 tools/test_item_use_order_parity.py: both standing and gliding cases match vanilla.
  • python3 tools/test_server_knockback_parity.py: passes; 22/23 cases match, with the harness's existing pvp-mace exception unchanged.
  • Real integrated-server before/after flight in fresh scratch worlds, with ordinary movement and item-use input. In the captured run, forward speed was 0.57 → 0.23 blocks/tick before the fix and 0.57 → 1.13 afterwards. Throw inaccuracy and timing vary; these are observations, not fixed boost values.
  • Before the fix, the protocol reproduction spawned a charge around X=16.5 with VX≈8 after the later move; vanilla spawned it at X=0.5 with VX≈0. The fixed server uses the old source in both tested poses.

The quick self-check runs offline in an isolated network namespace because the host proxy intercepts the protocol test's TEST-NET address. Project-local temporary files are bound to /tmp for the existing git-temp tests. The two focused vanilla harnesses above ran separately; the full affected set remains for CI.

pr_ready (tools/pr_ready.py --quick on omarchy, against origin/main at bd8c53bfa, 3 min 37 s)

Check Result
Scope ✅ 4 files, +147 −6
Cargo.lock ✅ unchanged
Public tree ✅ (1 s)
Python tests ✅ 515 passed (20 s)
rustfmt ✅ (6 s)
clippy ✅ (1 min 7 s)
tests: horizon-client ✅ 1668 passed (1 min 59 s)
doc tests ✅ 0 passed (1 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 ➖ 317 affected, to run in CI (--quick): blending, block_removal, block_survival, bundle_weight, camera, canyon_carver, carving_geometry, carving_mask, cauldron, cave_carver, chat_screen, chest_pair and 305 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Screenshots

Recorded forward velocity before and after the same integrated-server flight script. Sample zero is the last observation before the downward throw; the gap across the throw includes control calls. Only the interval where both runs are airborne is shown.

Forward velocity before and after

Recorded samples (CSV). Evidence is on a separate fork branch and adds no assets to this PR.

🤖 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/5868 **Author:** [@oskal675-design](https://github.com/oskal675-design) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/gliding-explosion-impulse` --- ### 📝 Commits (1) - [`7b2497f`](https://github.com/horizon-rust/horizon/commit/7b2497f52c39cda88c76a781b188f71ffa0028a0) Keep item use ahead of later player movement ### 📊 Changes **4 files changed** (+147 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/lan/hub.rs` (+8 -0) 📝 `mods/horizon/src/test/java/dev/horizonlab/parity/KnockbackClient.java` (+41 -6) 📝 `tests/test_game_home.py` (+1 -0) ➕ `tools/test_item_use_order_parity.py` (+97 -0) </details> ### 📄 Description > 🤖 Opened by oskal675-design's AI agent (Codex, GPT-6.1), not by oskal675-design personally. ## What and why Fixes #5828. A queued `UseItem` was handed to the game after the hub had already processed subsequent movement packets. A wind charge could therefore launch from the later position and inherit the later movement. During an elytra boost it could burst ahead of the player and remove forward momentum. Keep a later move queued until the item use has run, using the same barrier already applied to block uses and entity interactions. The gameplay change is eight lines in `Hub::process_inbox`. Add a real-server differential test: a vanilla-codec client batches an item use and a subsequent eight-block move into one network write. In both standing and gliding poses, the charge must originate at the old position with the old movement. The Java client records spawn X by block and velocity X rounded to a block/tick to separate this ordering error from random throw inaccuracy. The harness also confirms both servers actually started gliding. Its servers use the existing scratch-home `Server` helper; the home-safety test explicitly records that delegation. ## 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 Minecraft Java 26.3 `ServerGamePacketListenerImpl.handleUseItem` uses the player's state when that packet runs; a subsequent `handleMovePlayer` updates it afterwards. `WindChargeItem.use` creates the charge at the player's current position, and `Projectile.shootFromRotation` adds `ServerPlayer.getKnownMovement`. Read those methods from the pinned vanilla jar. `tools/test_item_use_order_parity.py` checks that ordering against an actual vanilla dedicated server using vanilla's packet codecs. `tools/port_ledger.py check --base origin/main` reports no new gaps for this change. ## Other projects' code none ## Self-check - `python3 tools/test_item_use_order_parity.py`: both standing and gliding cases match vanilla. - `python3 tools/test_server_knockback_parity.py`: passes; 22/23 cases match, with the harness's existing `pvp-mace` exception unchanged. - Real integrated-server before/after flight in fresh scratch worlds, with ordinary movement and item-use input. In the captured run, forward speed was 0.57 → 0.23 blocks/tick before the fix and 0.57 → 1.13 afterwards. Throw inaccuracy and timing vary; these are observations, not fixed boost values. - Before the fix, the protocol reproduction spawned a charge around X=16.5 with VX≈8 after the later move; vanilla spawned it at X=0.5 with VX≈0. The fixed server uses the old source in both tested poses. The quick self-check runs offline in an isolated network namespace because the host proxy intercepts the protocol test's TEST-NET address. Project-local temporary files are bound to `/tmp` for the existing git-temp tests. The two focused vanilla harnesses above ran separately; the full affected set remains for CI. **pr_ready** (`tools/pr_ready.py --quick` on omarchy, against origin/main at bd8c53bfa, 3 min 37 s) | Check | Result | | --- | --- | | Scope | ✅ 4 files, +147 −6 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ (1 s) | | Python tests | ✅ 515 passed (20 s) | | rustfmt | ✅ (6 s) | | clippy | ✅ (1 min 7 s) | | tests: horizon-client | ✅ 1668 passed (1 min 59 s) | | doc tests | ✅ 0 passed (1 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 | ➖ 317 affected, to run in CI (--quick): blending, block_removal, block_survival, bundle_weight, camera, canyon_carver, carving_geometry, carving_mask, cauldron, cave_carver, chat_screen, chest_pair and 305 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | ## Screenshots Recorded forward velocity before and after the same integrated-server flight script. Sample zero is the last observation before the downward throw; the gap across the throw includes control calls. Only the interval where both runs are airborne is shown. ![Forward velocity before and after](https://raw.githubusercontent.com/oskal675-design/horizon/0ac0176ade462a078b9cdc9f713a234374d5eb0a/velocity.png) [Recorded samples (CSV)](https://raw.githubusercontent.com/oskal675-design/horizon/0ac0176ade462a078b9cdc9f713a234374d5eb0a/velocity.csv). Evidence is on a separate fork branch and adds no assets to this PR. 🤖 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:22:27 +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#6527
No description provided.