[PR #2613] [MERGED] Multiplayer parity: movement, offhand swap, eat gating and farmland push #4473

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2613
Author: @socksprox
Created: 10/27/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: t3/anticheat-parity-elytra-swap-noslow


📝 Commits (4)

  • 64cd55c Finish a use on the server's USE_ITEM_COMPLETE, and eat on the client too
  • e70ead5 Multiplayer parity: four client/server movement and use divergences
  • 7b11005 Merge remote-tracking branch 'origin/main' into HEAD
  • c79b5be Merge #2564

📊 Changes

8 files changed (+280 additions, -72 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+10 -2)
📝 crates/horizon-client/src/game/consume.rs (+10 -0)
📝 crates/horizon-client/src/game/lan_actions.rs (+35 -14)
📝 crates/horizon-client/src/game/potions.rs (+1 -0)
📝 crates/horizon-client/src/game/remote.rs (+146 -50)
📝 crates/horizon-client/src/lan/hub.rs (+8 -3)
📝 crates/horizon-client/src/landing.rs (+5 -2)
📝 tools/lan_e2e.py (+65 -1)

📄 Description

🤖 Opened by socksprox's AI agent (Devin), not by socksprox himself.

Summary

Brings four client/server behaviors to vanilla parity (26.3):

  • Farmland phase-through: MotionWorld's BlockLandingWorld hardcoded is_server_level() == true, so a remote client trampled farmland/turtle eggs locally with its own RNG while the server trampled independently — ghost blocks plus a ±1/16-block position desync that left the player inside the grown block. is_server_level/is_client_side now reflect player.client_side; vanilla gates fallOn trampling on level instanceof ServerLevel.
  • Swap offhand (F): remote_swap_hands sent ServerboundPlayerActionPacket SWAP_ITEM_WITH_OFFHAND straight from the window-event callback, off the tick boundary — the same leak the click queue was built to avoid (a packet between CLIENT_TICK_END and a later pong). F, Q-drop, and the mount-inventory key (E) now queue onto Remote::pending_keys and fire during remote_handle_input, matching vanilla's handleKeybinds phase.
  • Eating while not hungry (noslow desync): remote_use_item returned item_has_use(info) regardless of the predicted result, so a refused consume (full hunger) still ended the hand's click as if it succeeded and applied a use cooldown. It now behaves like vanilla's InteractionResult.FAIL — start_eating already gates on canEat (can_always_eat || food < 20 || creative) — so no using state or slowdown starts, the cooldown isn't applied, and the offhand gets its turn.
  • Elytra landing: the host's "moved too quickly" check dropped vanilla's expectedDist term (player.getDeltaMovement().lengthSqr()). Guests' server-simulated velocity is now subtracted from movedDist, matching ServerGamePacketListenerImpl.handlePlayerPositionChange (300 b/t limit while fall-flying, 100 otherwise).

Verification

  • cargo check -p horizon-client --lib --bins — clean
  • cargo clippy -p horizon-client --lib --bins -- -D warnings — clean
  • rustfmt --check on the four touched files — clean
  • cargo test -p horizon-client --bins remote — 16 passed
  • Full tools/pr_ready.py not run; harness selection via tools/parity.py --changed left for CI.

🤖 Generated with Devin


🔄 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/2613 **Author:** [@socksprox](https://github.com/socksprox) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `t3/anticheat-parity-elytra-swap-noslow` --- ### 📝 Commits (4) - [`64cd55c`](https://github.com/horizon-rust/horizon/commit/64cd55cf74d7ae27b67bc69b737a98f53274a59d) Finish a use on the server's USE_ITEM_COMPLETE, and eat on the client too - [`e70ead5`](https://github.com/horizon-rust/horizon/commit/e70ead5bfe57eac08d45065d62859b5e326aebc1) Multiplayer parity: four client/server movement and use divergences - [`7b11005`](https://github.com/horizon-rust/horizon/commit/7b11005688b4cbecb29fc2197406fc69b4c0b64a) Merge remote-tracking branch 'origin/main' into HEAD - [`c79b5be`](https://github.com/horizon-rust/horizon/commit/c79b5be2e4f299d765558ee86c84785410ccf314) Merge #2564 ### 📊 Changes **8 files changed** (+280 additions, -72 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+10 -2) 📝 `crates/horizon-client/src/game/consume.rs` (+10 -0) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+35 -14) 📝 `crates/horizon-client/src/game/potions.rs` (+1 -0) 📝 `crates/horizon-client/src/game/remote.rs` (+146 -50) 📝 `crates/horizon-client/src/lan/hub.rs` (+8 -3) 📝 `crates/horizon-client/src/landing.rs` (+5 -2) 📝 `tools/lan_e2e.py` (+65 -1) </details> ### 📄 Description > 🤖 Opened by socksprox's AI agent (Devin), not by socksprox himself. ## Summary Brings four client/server behaviors to vanilla parity (26.3): - **Farmland phase-through**: `MotionWorld`'s `BlockLandingWorld` hardcoded `is_server_level() == true`, so a remote client trampled farmland/turtle eggs locally with its own RNG while the server trampled independently — ghost blocks plus a ±1/16-block position desync that left the player inside the grown block. `is_server_level`/`is_client_side` now reflect `player.client_side`; vanilla gates `fallOn` trampling on `level instanceof ServerLevel`. - **Swap offhand (F)**: `remote_swap_hands` sent `ServerboundPlayerActionPacket SWAP_ITEM_WITH_OFFHAND` straight from the window-event callback, off the tick boundary — the same leak the click queue was built to avoid (a packet between `CLIENT_TICK_END` and a later pong). F, Q-drop, and the mount-inventory key (E) now queue onto `Remote::pending_keys` and fire during `remote_handle_input`, matching vanilla's `handleKeybinds` phase. - **Eating while not hungry (noslow desync)**: `remote_use_item` returned `item_has_use(info)` regardless of the predicted result, so a refused consume (full hunger) still ended the hand's click as if it succeeded and applied a use cooldown. It now behaves like vanilla's `InteractionResult.FAIL` — `start_eating` already gates on `canEat` (`can_always_eat || food < 20 || creative`) — so no `using` state or slowdown starts, the cooldown isn't applied, and the offhand gets its turn. - **Elytra landing**: the host's "moved too quickly" check dropped vanilla's `expectedDist` term (`player.getDeltaMovement().lengthSqr()`). Guests' server-simulated velocity is now subtracted from `movedDist`, matching `ServerGamePacketListenerImpl.handlePlayerPositionChange` (300 b/t limit while fall-flying, 100 otherwise). ## Verification - `cargo check -p horizon-client --lib --bins` — clean - `cargo clippy -p horizon-client --lib --bins -- -D warnings` — clean - `rustfmt --check` on the four touched files — clean - `cargo test -p horizon-client --bins remote` — 16 passed - Full `tools/pr_ready.py` not run; harness selection via `tools/parity.py --changed` left for CI. 🤖 Generated with [Devin](https://devin.ai) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:17:24 +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#4473
No description provided.