[PR #912] [MERGED] Fix vanilla multiplayer tick and interaction parity #2907

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

📋 Pull Request Information

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

Base: main ← Head: t3/fix-grimac-false-flags


📝 Commits (1)

  • 4de112f Fix multiplayer tick ordering and interaction target parity

📊 Changes

12 files changed (+1183 additions, -127 deletions)

View changed files

➕ crates/horizon-client/examples/interaction_input_fixture.rs (+122 -0)
➕ crates/horizon-client/examples/player_sync_fixture.rs (+72 -0)
📝 crates/horizon-client/src/game/hand.rs (+1 -1)
📝 crates/horizon-client/src/game/remote.rs (+257 -121)
➕ crates/horizon-client/src/interaction_input.rs (+186 -0)
📝 crates/horizon-client/src/lib.rs (+2 -0)
📝 crates/horizon-client/src/net.rs (+58 -5)
➕ crates/horizon-client/src/player_sync.rs (+86 -0)
➕ mods/horizon/src/test/java/dev/horizonlab/parity/VanillaInteractionInputOracle.java (+161 -0)
➕ mods/horizon/src/test/java/dev/horizonlab/parity/VanillaPlayerSyncOracle.java (+109 -0)
➕ tools/test_interaction_input_parity.py (+53 -0)
➕ tools/test_player_sync_parity.py (+76 -0)

📄 Description

What and why

Fix vanilla multiplayer differences that caused GrimAC to flag normal idle play, block/entity clicks, and placing while aiming at another player.

  • Handle pings on the game thread so pongs cannot overtake queued teleport acknowledgements. Send tick-end packets and movement reminders while waiting for chunks, and preserve vanilla's movement baseline and relative teleport velocity.
  • Queue mouse clicks for the tick's input phase, apply attack/use/pick/mining order, and release item use only when it is active. Sync the carried slot before interactions and defer screen-triggered mining cancellation to the tick.
  • Keep entity and block targets mutually exclusive. A passing entity interaction can fall back to using the held item, without placing or mining through the entity.

Vanilla reference

Follows the pinned 26.3 client's ClientCommonPacketListenerImpl.handlePing, ClientPacketListener.handleMovePlayer, PositionMoveRotation.calculateAbsolute, LocalPlayer.sendPosition, and Minecraft.tick, handleKeybinds, startAttack, continueAttack, and startUseItem.

Added test_player_sync_parity.py (942 cases, 24,707 matching output lines) and test_interaction_input_parity.py (392 cases, 1,484 matching output lines). The interaction oracle invokes vanilla's actual handleKeybinds, including passing entity interactions while holding a block. Added a network regression for teleport/ping ordering and four input regression tests.

Self-check

Both new vanilla harnesses passed locally. The targeted client test run passed 960 tests; 236 Python tests passed. The full repository self-check follows.

pr_ready (tools/pr_ready.py --quick on archlinux, against origin/main at 87cf8cb9e, 7 min 56 s)

Check Result
Scope ⚠️ 12 files, +1183 −127; 911 lines of code: over 500, split it if it can ship in parts
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 236 passed (21 s)
rustfmt ✅ (5 s)
clippy ✅ (32 s)
tests: horizon-client ✅ 982 passed (6 min 58 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🔄 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/912 **Author:** [@rdbtCVS](https://github.com/rdbtCVS) **Created:** 10/18/2026 **Status:** ✅ Merged **Merged:** 10/18/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `t3/fix-grimac-false-flags` --- ### 📝 Commits (1) - [`4de112f`](https://github.com/horizon-rust/horizon/commit/4de112fe1672088ce7fe4143ae6c416bc4b9fc50) Fix multiplayer tick ordering and interaction target parity ### 📊 Changes **12 files changed** (+1183 additions, -127 deletions) <details> <summary>View changed files</summary> ➕ `crates/horizon-client/examples/interaction_input_fixture.rs` (+122 -0) ➕ `crates/horizon-client/examples/player_sync_fixture.rs` (+72 -0) 📝 `crates/horizon-client/src/game/hand.rs` (+1 -1) 📝 `crates/horizon-client/src/game/remote.rs` (+257 -121) ➕ `crates/horizon-client/src/interaction_input.rs` (+186 -0) 📝 `crates/horizon-client/src/lib.rs` (+2 -0) 📝 `crates/horizon-client/src/net.rs` (+58 -5) ➕ `crates/horizon-client/src/player_sync.rs` (+86 -0) ➕ `mods/horizon/src/test/java/dev/horizonlab/parity/VanillaInteractionInputOracle.java` (+161 -0) ➕ `mods/horizon/src/test/java/dev/horizonlab/parity/VanillaPlayerSyncOracle.java` (+109 -0) ➕ `tools/test_interaction_input_parity.py` (+53 -0) ➕ `tools/test_player_sync_parity.py` (+76 -0) </details> ### 📄 Description ## What and why Fix vanilla multiplayer differences that caused GrimAC to flag normal idle play, block/entity clicks, and placing while aiming at another player. - Handle pings on the game thread so pongs cannot overtake queued teleport acknowledgements. Send tick-end packets and movement reminders while waiting for chunks, and preserve vanilla's movement baseline and relative teleport velocity. - Queue mouse clicks for the tick's input phase, apply attack/use/pick/mining order, and release item use only when it is active. Sync the carried slot before interactions and defer screen-triggered mining cancellation to the tick. - Keep entity and block targets mutually exclusive. A passing entity interaction can fall back to using the held item, without placing or mining through the entity. ## Vanilla reference Follows the pinned 26.3 client's `ClientCommonPacketListenerImpl.handlePing`, `ClientPacketListener.handleMovePlayer`, `PositionMoveRotation.calculateAbsolute`, `LocalPlayer.sendPosition`, and `Minecraft.tick`, `handleKeybinds`, `startAttack`, `continueAttack`, and `startUseItem`. Added `test_player_sync_parity.py` (942 cases, 24,707 matching output lines) and `test_interaction_input_parity.py` (392 cases, 1,484 matching output lines). The interaction oracle invokes vanilla's actual `handleKeybinds`, including passing entity interactions while holding a block. Added a network regression for teleport/ping ordering and four input regression tests. ## Self-check Both new vanilla harnesses passed locally. The targeted client test run passed 960 tests; 236 Python tests passed. The full repository self-check follows. **pr_ready** (`tools/pr_ready.py --quick` on archlinux, against origin/main at 87cf8cb9e, 7 min 56 s) | Check | Result | | --- | --- | | Scope | ⚠️ 12 files, +1183 −127; 911 lines of code: over 500, split it if it can ship in parts | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 236 passed (21 s) | | rustfmt | ✅ (5 s) | | clippy | ✅ (32 s) | | tests: horizon-client | ✅ 982 passed (6 min 58 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | --- <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:01 +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#2907
No description provided.