[PR #1831] [MERGED] Update comparators when a guest changes a chest through its menu #3797

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

📋 Pull Request Information

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

Base: main ← Head: fix/1503-guest-chest-comparator


📝 Commits (1)

  • 467277e Update comparators when a guest changes a chest through its menu

📊 Changes

1 file changed (+13 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/game/lan_actions.rs (+13 -0)

📄 Description

What and why

Fixes #1503.

With the server thread (and for LAN guests), clicks in a chest, barrel, hopper, dispenser or shulker box menu changed the block entity's slots but never told the world about it. A comparator reading the chest kept its old output until some unrelated block update made it look again. The in-frame path already does this after each click.

Now, when a container click changes the container's slots, the game calls the same container_changed (BlockEntity.setChanged) the in-frame menus use, which marks the chunk modified and updates the comparator output. A double chest's other half follows, as before.

Furnace, brewing stand and crafter menus go through a separate path (lan_machine_click) and are not changed here.

Vanilla reference

  • Slot.setChanged -> Container.setChanged -> BlockEntity.setChanged, which calls Level.updateNeighbourForOutputSignal when the block has an analog output (ChestBlockEntity, CompoundContainer.setChanged for both halves).

No harness covers a guest's container clicks driving a comparator; I ran the existing harnesses for the touched code: python3 tools/parity.py lan menu_click (2 passed). cargo check -p horizon-client is clean.

Self-check

pr_ready (tools/pr_ready.py --quick on device-591, against origin/main at 220f05764, 2 min 34 s)

Check Result
Scope ✅ 1 files, +13 −0
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅ (5 s)
clippy ✅ (19 s)
tests: horizon-client ✅ 1236 passed (2 min 7 s)
doc tests ✅ 0 passed (2 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 319 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, bamboo, basic_feature and 307 more
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/1831 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/1503-guest-chest-comparator` --- ### 📝 Commits (1) - [`467277e`](https://github.com/horizon-rust/horizon/commit/467277ef6d70de648f45ce6c66409b28644d796e) Update comparators when a guest changes a chest through its menu ### 📊 Changes **1 file changed** (+13 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/lan_actions.rs` (+13 -0) </details> ### 📄 Description ## What and why Fixes #1503. With the server thread (and for LAN guests), clicks in a chest, barrel, hopper, dispenser or shulker box menu changed the block entity's slots but never told the world about it. A comparator reading the chest kept its old output until some unrelated block update made it look again. The in-frame path already does this after each click. Now, when a container click changes the container's slots, the game calls the same `container_changed` (`BlockEntity.setChanged`) the in-frame menus use, which marks the chunk modified and updates the comparator output. A double chest's other half follows, as before. Furnace, brewing stand and crafter menus go through a separate path (`lan_machine_click`) and are not changed here. ## Vanilla reference - `Slot.setChanged` -> `Container.setChanged` -> `BlockEntity.setChanged`, which calls `Level.updateNeighbourForOutputSignal` when the block has an analog output (`ChestBlockEntity`, `CompoundContainer.setChanged` for both halves). No harness covers a guest's container clicks driving a comparator; I ran the existing harnesses for the touched code: `python3 tools/parity.py lan menu_click` (2 passed). `cargo check -p horizon-client` is clean. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on device-591, against origin/main at 220f05764, 2 min 34 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +13 −0 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (5 s) | | clippy | ✅ (19 s) | | tests: horizon-client | ✅ 1236 passed (2 min 7 s) | | doc tests | ✅ 0 passed (2 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 319 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, bamboo, basic_feature and 307 more | | 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-03 04:12:23 +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#3797
No description provided.