[PR #626] [MERGED] Keep server blocks in sync with what guests dig #2679

Closed
opened 2026-11-02 15:58:10 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: fix/server-block-break


📝 Commits (6)

  • 66d187e Respawn on a server in vanilla's order, so vanilla clients leave the loading screen
  • 256ecc4 Keep server blocks in sync with what guests dig
  • 4097058 Wrap mixed translation arguments once, so vanilla clients can read /give
  • e7f7236 Open furnaces, blast furnaces and smokers on a server
  • 1a68d8d Merge main into fix/furnace-on-server
  • 51703fd Merge remote-tracking branch 'pr/626' into HEAD

📊 Changes

10 files changed (+650 additions, -80 deletions)

View changed files

📝 crates/horizon-client/src/game/lan_actions.rs (+146 -27)
📝 crates/horizon-client/src/game/lan_crafting.rs (+73 -1)
📝 crates/horizon-client/src/game/remote.rs (+57 -7)
📝 crates/horizon-client/src/lan/containers.rs (+45 -1)
📝 crates/horizon-client/src/lan/data.rs (+30 -16)
📝 crates/horizon-client/src/lan/guest.rs (+6 -0)
📝 crates/horizon-client/src/lan/hub.rs (+88 -17)
📝 crates/horizon-client/src/lan/menu.rs (+2 -0)
📝 mods/horizon/src/test/java/dev/horizonlab/parity/VanillaProtocolClient.java (+162 -7)
📝 tools/test_dedicated_server_parity.py (+41 -4)

📄 Description

Fixes #500

What was wrong

On a Horizon server (LAN host or dedicated), a guest's STOP_DESTROY_BLOCK just cleared the digging. The host's own count (with a 5-tick pause between blocks) was usually behind the client's, so the block the client had broken stayed on the server: the player walked into a block that the client showed as air, fell or froze, and some died. The client also ignored BlockChangedAck, and the host sent each ack before the block updates of that tick.

What changed

  • Host (game/lan_actions.rs), following ServerPlayerGameMode.handleBlockBreakAction:
    • START records the server tick the digging began; the pause between blocks is the client's, as in vanilla.
    • STOP breaks the block when destroyProgress * (ticks since START + 1) >= 0.7. Otherwise the host keeps digging alone and breaks the block when its progress reaches 1 (the delayed destroy, ticked before the guest's server tick).
    • ABORT is unchanged.
  • Acks (lan/hub.rs, lan/guest.rs): ack() keeps the highest sequence, and the tick sends it right after the block changes, like ServerGamePacketListenerImpl.ackBlockChangesUpTo.
  • Client on a remote server (game/remote.rs): a small BlockStatePredictionHandler. A predicted break remembers the server's state. Block updates for that position only update the remembered state until BlockChangedAck covers its sequence, then the block takes the server's state, so a refused break comes back.

Verification

  • cargo fmt --all --check and cargo clippy -p horizon-client --all-targets -- -D warnings are clean.
  • The lib tests and tools/parity.py --changed origin/main run once on an integration commit with the other multiplayer fixes; the results will be posted here.

🤖 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/626 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/17/2026 **Status:** ✅ Merged **Merged:** 10/17/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/server-block-break` --- ### 📝 Commits (6) - [`66d187e`](https://github.com/horizon-rust/horizon/commit/66d187ed06e904a2937ef6da51189f8193fc6d37) Respawn on a server in vanilla's order, so vanilla clients leave the loading screen - [`256ecc4`](https://github.com/horizon-rust/horizon/commit/256ecc4daafd90d8455d0e37f09e34897d1a1b64) Keep server blocks in sync with what guests dig - [`4097058`](https://github.com/horizon-rust/horizon/commit/40970589bef33063caff17618b2325646f978ba0) Wrap mixed translation arguments once, so vanilla clients can read /give - [`e7f7236`](https://github.com/horizon-rust/horizon/commit/e7f7236c342f1bb3e160308f154590bf125f0495) Open furnaces, blast furnaces and smokers on a server - [`1a68d8d`](https://github.com/horizon-rust/horizon/commit/1a68d8ddf0140a7496932e8629060b2e60c573ea) Merge main into fix/furnace-on-server - [`51703fd`](https://github.com/horizon-rust/horizon/commit/51703fdf3b498b4334c399e306f8e263cbccfffb) Merge remote-tracking branch 'pr/626' into HEAD ### 📊 Changes **10 files changed** (+650 additions, -80 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/lan_actions.rs` (+146 -27) 📝 `crates/horizon-client/src/game/lan_crafting.rs` (+73 -1) 📝 `crates/horizon-client/src/game/remote.rs` (+57 -7) 📝 `crates/horizon-client/src/lan/containers.rs` (+45 -1) 📝 `crates/horizon-client/src/lan/data.rs` (+30 -16) 📝 `crates/horizon-client/src/lan/guest.rs` (+6 -0) 📝 `crates/horizon-client/src/lan/hub.rs` (+88 -17) 📝 `crates/horizon-client/src/lan/menu.rs` (+2 -0) 📝 `mods/horizon/src/test/java/dev/horizonlab/parity/VanillaProtocolClient.java` (+162 -7) 📝 `tools/test_dedicated_server_parity.py` (+41 -4) </details> ### 📄 Description Fixes #500 ## What was wrong On a Horizon server (LAN host or dedicated), a guest's `STOP_DESTROY_BLOCK` just cleared the digging. The host's own count (with a 5-tick pause between blocks) was usually behind the client's, so the block the client had broken stayed on the server: the player walked into a block that the client showed as air, fell or froze, and some died. The client also ignored `BlockChangedAck`, and the host sent each ack before the block updates of that tick. ## What changed - **Host** (`game/lan_actions.rs`), following `ServerPlayerGameMode.handleBlockBreakAction`: - START records the server tick the digging began; the pause between blocks is the client's, as in vanilla. - STOP breaks the block when `destroyProgress * (ticks since START + 1) >= 0.7`. Otherwise the host keeps digging alone and breaks the block when its progress reaches 1 (the delayed destroy, ticked before the guest's server tick). - ABORT is unchanged. - **Acks** (`lan/hub.rs`, `lan/guest.rs`): `ack()` keeps the highest sequence, and the tick sends it right after the block changes, like `ServerGamePacketListenerImpl.ackBlockChangesUpTo`. - **Client on a remote server** (`game/remote.rs`): a small `BlockStatePredictionHandler`. A predicted break remembers the server's state. Block updates for that position only update the remembered state until `BlockChangedAck` covers its sequence, then the block takes the server's state, so a refused break comes back. ## Verification - `cargo fmt --all --check` and `cargo clippy -p horizon-client --all-targets -- -D warnings` are clean. - The lib tests and `tools/parity.py --changed origin/main` run once on an integration commit with the other multiplayer fixes; the results will be posted here. 🤖 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-02 15:58:10 +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#2679
No description provided.