[PR #4297] [MERGED] A server's copy of a player jumps with them, so Lunge keeps the jump #5546

Closed
opened 2026-11-03 05:13:19 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4297
Author: @hhamaj
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @levzzz5154

Base: main ← Head: fix/lunge-keeps-air-motion


📝 Commits (1)

  • 9465fb9 A server's copy of a player jumps with them, so Lunge keeps the jump

📊 Changes

3 files changed (+111 additions, -5 deletions)

View changed files

📝 crates/horizon-client/src/game/lan_actions.rs (+4 -3)
📝 mods/horizon/src/test/java/dev/horizonlab/parity/LocatorBarClient.java (+52 -2)
➕ tools/test_lunge_motion_parity.py (+55 -0)

📄 Description

🤖 Opened by hhamaj's AI agent (Claude Code, Opus 5.5), not by hhamaj personally.

What and why

Found and narrowed down by @hhamaj by playing both games. They spotted that Lunge cuts a sprint-jump in Horizon, then tested vanilla 26.3 and Horizon side by side and found the key difference: in vanilla the jump is cut only when the jab lands in the same tick as the jump, while in Horizon it is cut every time. That result pointed the investigation at the server's copy of the player, and the numbers below confirm it.

Lunge pushed a player down when used in a jump. The impulse itself was right. ApplyEntityImpulse sends the server copy's whole velocity in ClientboundSetEntityMotionPacket, the client replaces its own velocity with it, and Horizon's server copy had no jump in it.

ServerGamePacketListenerImpl.handlePlayerPositionChange calls jumpFromGround when a player on the ground moves up and is no longer on the ground, so vanilla's server copy jumps with the player and then travels. Horizon detected that same condition in guest_server_tick but only charged the food exhaustion. It now calls jump_from_ground, which also charges the exhaustion, gives the sprint boost and counts the jump statistic, which a server's players never got.

SetEntityMotion y after a jab with Lunge III, on a vanilla and a Horizon dedicated server:

Jab Vanilla Before After
Standing -0.0784 -0.0784 -0.0784
Same tick as the jump -0.0784 -0.0784 -0.0784
Rising, tick 3 0.1648 -0.3043 0.1648
Falling, tick 8 -0.2277 -0.6517 -0.2277

Vanilla's jump tick cut is kept: the jab goes out before that tick's position, so the server doesn't know of the jump yet. Sprinting also matches vanilla: 0, 0.1648, 1.5248.

The extra z in the issue's same-tick row (1.3957) came from the harness, not the game: its client had said it was off the ground. The harness now lands first. Horizon's copy trusts the client's on-ground flag there, which a real client sends correctly.

Fixes #4278

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

ServerGamePacketListenerImpl.handlePlayerPositionChange, LivingEntity.jumpFromGround, ApplyEntityImpulse.apply, MultiPlayerGameMode.piercingAttack.

Harness: tools/test_lunge_motion_parity.py, on a vanilla and a Horizon dedicated server: the motions a vanilla-protocol client receives after jabs standing, in the jump's tick, rising, falling and sprinting. It failed before this change and passes with it. LocatorBarClient gains stab, arc and sprint, and records the player's own SetEntityMotion under state on.

Also passed here: dedicated_server, server_entities, server_player_damage.

Limits of what was checked:

  • The change affects every velocity sent to a player after a jump, such as knockback. I only measured Lunge.
  • port_ledger check was not run; build failed here on #4222 too.
  • Not tried in a real game by a person yet with this exact commit.

Self-check

Run before the commit, so its Scope row counted two unrelated untracked files. The pull request is 3 files.

pr_ready (tools/pr_ready.py --quick --base upstream/main on nixos, against upstream/main at 45982faa5, 6 min 24 s)

Check Result
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 480 passed (33 s)
rustfmt ✅ (7 s)
clippy ✅ (1 min 26 s)
tests: horizon-client ✅ 972 passed (4 min 12 s)
doc tests ✅ 0 passed (3 s)
Parity ➖ 354 affected, to run in CI (--quick)

🤖 Generated with Claude Code


🔄 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/4297 **Author:** [@hhamaj](https://github.com/hhamaj) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix/lunge-keeps-air-motion` --- ### 📝 Commits (1) - [`9465fb9`](https://github.com/horizon-rust/horizon/commit/9465fb9cb759a117636db189cb7c65a6a665a248) A server's copy of a player jumps with them, so Lunge keeps the jump ### 📊 Changes **3 files changed** (+111 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/lan_actions.rs` (+4 -3) 📝 `mods/horizon/src/test/java/dev/horizonlab/parity/LocatorBarClient.java` (+52 -2) ➕ `tools/test_lunge_motion_parity.py` (+55 -0) </details> ### 📄 Description > 🤖 Opened by hhamaj's AI agent (Claude Code, Opus 5.5), not by hhamaj personally. ## What and why Found and narrowed down by @hhamaj by playing both games. They spotted that Lunge cuts a sprint-jump in Horizon, then tested vanilla 26.3 and Horizon side by side and found the key difference: in vanilla the jump is cut only when the jab lands in the same tick as the jump, while in Horizon it is cut every time. That result pointed the investigation at the server's copy of the player, and the numbers below confirm it. Lunge pushed a player down when used in a jump. The impulse itself was right. `ApplyEntityImpulse` sends the server copy's whole velocity in `ClientboundSetEntityMotionPacket`, the client replaces its own velocity with it, and Horizon's server copy had no jump in it. `ServerGamePacketListenerImpl.handlePlayerPositionChange` calls `jumpFromGround` when a player on the ground moves up and is no longer on the ground, so vanilla's server copy jumps with the player and then travels. Horizon detected that same condition in `guest_server_tick` but only charged the food exhaustion. It now calls `jump_from_ground`, which also charges the exhaustion, gives the sprint boost and counts the `jump` statistic, which a server's players never got. `SetEntityMotion` y after a jab with Lunge III, on a vanilla and a Horizon dedicated server: | Jab | Vanilla | Before | After | |---|---|---|---| | Standing | -0.0784 | -0.0784 | -0.0784 | | Same tick as the jump | -0.0784 | -0.0784 | -0.0784 | | Rising, tick 3 | 0.1648 | -0.3043 | 0.1648 | | Falling, tick 8 | -0.2277 | -0.6517 | -0.2277 | Vanilla's jump tick cut is kept: the jab goes out before that tick's position, so the server doesn't know of the jump yet. Sprinting also matches vanilla: 0, 0.1648, 1.5248. The extra z in the issue's same-tick row (1.3957) came from the harness, not the game: its client had said it was off the ground. The harness now lands first. Horizon's copy trusts the client's on-ground flag there, which a real client sends correctly. Fixes #4278 ## 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 `ServerGamePacketListenerImpl.handlePlayerPositionChange`, `LivingEntity.jumpFromGround`, `ApplyEntityImpulse.apply`, `MultiPlayerGameMode.piercingAttack`. Harness: `tools/test_lunge_motion_parity.py`, on a vanilla and a Horizon dedicated server: the motions a vanilla-protocol client receives after jabs standing, in the jump's tick, rising, falling and sprinting. It failed before this change and passes with it. `LocatorBarClient` gains `stab`, `arc` and `sprint`, and records the player's own `SetEntityMotion` under `state on`. Also passed here: `dedicated_server`, `server_entities`, `server_player_damage`. Limits of what was checked: - The change affects every velocity sent to a player after a jump, such as knockback. I only measured Lunge. - `port_ledger check` was not run; `build` failed here on #4222 too. - Not tried in a real game by a person yet with this exact commit. ## Self-check Run before the commit, so its Scope row counted two unrelated untracked files. The pull request is 3 files. **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on nixos, against upstream/main at 45982faa5, 6 min 24 s) | Check | Result | | --- | --- | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 480 passed (33 s) | | rustfmt | ✅ (7 s) | | clippy | ✅ (1 min 26 s) | | tests: horizon-client | ✅ 972 passed (4 min 12 s) | | doc tests | ✅ 0 passed (3 s) | | Parity | ➖ 354 affected, to run in CI (--quick) | 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:13:19 +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#5546
No description provided.