[GH-ISSUE #869] [multiplayer] Guest block uses wait for the server: predict doors, trapdoors, fence gates, levers #247

Closed
opened 2026-11-02 15:37:38 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @ludovic111 on GitHub (Oct 18, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/869

🤖 Filed by Ludovic's AI agent (Claude), not by Ludovic himself.

Split from #803. A LAN or server guest's door, trapdoor, fence gate, lever or button changes only when the server's block update arrives, one round trip after the click. Vanilla shows the change at once.

Vanilla 26.3:

  • MultiPlayerGameMode.useItemOn runs performUseItemOn on the client inside startPrediction, so the use already happens on the client level. For example, DoorBlock.useWithoutItem cycles OPEN, and the other half follows through updateShape.
  • Every block it changes is recorded in BlockStatePredictionHandler under the packet's sequence number.
  • ClientboundBlockChangedAckPacket then ends those predictions (endPredictionsUpTo). A block the server refused goes back to the server's state.
  • Sounds started with level.playSound(player, …) play on the client only for the player who caused them. The server sends them to everyone else.

Horizon's guest (game/remote.rs):

  • It already keeps predictions and sequences for block breaking: predict_break, server_block, end_predictions.
  • remote_use sends UseItemOn with a sequence, but it doesn't run the use locally.

To fix it, run the block's useWithoutItem / useItemOn on the guest under that sequence and record each changed block as a prediction, as predict_break does. Start with the hand-openable doors, trapdoors and fence gates (not iron ones), then levers and buttons. Only the guest that clicked should hear the sound locally, so the host also has to stop sending that sound back to it.

A tools/lan_e2e.py check can read the guest's door state in the interact reply, before the server's answer. That reply comes back in the same frame, so the check doesn't need added latency. It should check that an iron door stays shut on both sides. Run it with and without --server-thread.

The other half of #803 (remote players' eating) is fixed separately.

Originally created by @ludovic111 on GitHub (Oct 18, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/869 > 🤖 Filed by Ludovic's AI agent (Claude), not by Ludovic himself. Split from #803. A LAN or server guest's door, trapdoor, fence gate, lever or button changes only when the server's block update arrives, one round trip after the click. Vanilla shows the change at once. Vanilla 26.3: - `MultiPlayerGameMode.useItemOn` runs `performUseItemOn` on the client inside `startPrediction`, so the use already happens on the client level. For example, `DoorBlock.useWithoutItem` cycles `OPEN`, and the other half follows through `updateShape`. - Every block it changes is recorded in `BlockStatePredictionHandler` under the packet's sequence number. - `ClientboundBlockChangedAckPacket` then ends those predictions (`endPredictionsUpTo`). A block the server refused goes back to the server's state. - Sounds started with `level.playSound(player, …)` play on the client only for the player who caused them. The server sends them to everyone else. Horizon's guest (`game/remote.rs`): - It already keeps predictions and sequences for block breaking: `predict_break`, `server_block`, `end_predictions`. - `remote_use` sends `UseItemOn` with a sequence, but it doesn't run the use locally. To fix it, run the block's `useWithoutItem` / `useItemOn` on the guest under that sequence and record each changed block as a prediction, as `predict_break` does. Start with the hand-openable doors, trapdoors and fence gates (not iron ones), then levers and buttons. Only the guest that clicked should hear the sound locally, so the host also has to stop sending that sound back to it. A `tools/lan_e2e.py` check can read the guest's door state in the `interact` reply, before the server's answer. That reply comes back in the same frame, so the check doesn't need added latency. It should check that an iron door stays shut on both sides. Run it with and without `--server-thread`. The other half of #803 (remote players' eating) is fixed separately.
Author
Owner

@ludovic111 commented on GitHub (Oct 22, 2026):

🤖 Agent: #1151 predicts a guest's use of doors, trapdoors, fence gates, levers and buttons, as MultiPlayerGameMode.useItemOn does. The guest also plays the sound right away, and the server sends that sound only to the other players.

<!-- gh-comment-id:6330340759 --> @ludovic111 commented on GitHub (Oct 22, 2026): 🤖 Agent: #1151 predicts a guest's use of doors, trapdoors, fence gates, levers and buttons, as `MultiPlayerGameMode.useItemOn` does. The guest also plays the sound right away, and the server sends that sound only to the other players.
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#247
No description provided.