[PR #1812] [MERGED] Trapped chests give their signal, barrels show they're open #3783

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

📋 Pull Request Information

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

Base: main ← Head: fix/trapped-chest-signal-barrel-open


📝 Commits (2)

  • 0f2a497 Trapped chests give their signal, barrels show they're open
  • 4512105 Merge origin/main into fix/trapped-chest-signal-barrel-open

📊 Changes

3 files changed (+61 additions, -8 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+7 -0)
📝 crates/horizon-client/src/game/block_entity_anims.rs (+53 -7)
📝 crates/horizon-client/src/game/machines/crafter.rs (+1 -1)

📄 Description

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

What the player reported

.dezerx on Discord (#horizon-bugs, 2026-10-25, single player): "Minecraft trapped chest doesn't emit a redstone signal", and "When opening a barrel, it doesn't show the brown shadow to indicate that it's open".

Vanilla rule

  • TrappedChestBlock.getSignal = clamp(ChestBlockEntity.getOpenCount, 0, 15) (direct signal upwards only); TrappedChestBlockEntity.signalOpenCount calls updateNeighborsAt(pos) and updateNeighborsAt(pos.below()) when the count changes.
  • BarrelBlockEntity.openersCounter: onOpen → updateBlockState(state, true), onClose → false: setBlock(pos, state.setValue(OPEN, …), UPDATE_ALL), which swaps the top for barrel_top_open.

Cause

Both missing in every mode: the world code asks LevelAccess::block_entity_signal for a trapped chest, and GameLevel only answered jukeboxes (0 for trapped chests); nothing ever set a barrel's open. The opener counting already existed (lid_openers, the host and every guest).

Change

  • GameLevel borrows lid_openers; block_entity_signal returns the trapped chest's count.
  • lid_openers_changed updates the trapped chest's neighbours and the block below when its count changes.
  • Barrels count their openers the same way and set open when the first opens and the last closes (set_bool_prop from crafter.rs, now pub(crate)).

Tested

  • Server thread and --in-frame, survival: a trapped chest with a redstone lamp beside it; opening the chest lights the lamp (execute if block … redstone_lamp[lit=true] passes), closing it turns it off. A barrel reads open=true while its menu is open and open=false once closed.
  • LAN guests and dedicated servers use the same opener code (container_openers_changed).

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at 6a065fa48, 2 min 56 s)

Check Result
Scope ✅ 3 files, +61 −8
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅ (5 s)
clippy ✅ (6 s)
tests: horizon-client ✅ 1236 passed (2 min 26 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 ➖ 27 affected, to run in CI (--quick): arrow, block_particles, block_removal, breaking_model, command_exec, composter, crafter, dedicated_server, dispenser, enchanting, locator_bar, mace and 15 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Named harnesses (local): redstone PASS, block_entity_anim PASS.

🤖 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/1812 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/trapped-chest-signal-barrel-open` --- ### 📝 Commits (2) - [`0f2a497`](https://github.com/horizon-rust/horizon/commit/0f2a497f0241248adcbe88d564004b0c9bec122f) Trapped chests give their signal, barrels show they're open - [`4512105`](https://github.com/horizon-rust/horizon/commit/4512105e85bfdd606f60405e62839637f2bec12c) Merge origin/main into fix/trapped-chest-signal-barrel-open ### 📊 Changes **3 files changed** (+61 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+7 -0) 📝 `crates/horizon-client/src/game/block_entity_anims.rs` (+53 -7) 📝 `crates/horizon-client/src/game/machines/crafter.rs` (+1 -1) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What the player reported .dezerx on Discord (#horizon-bugs, 2026-10-25, single player): "Minecraft trapped chest doesn't emit a redstone signal", and "When opening a barrel, it doesn't show the brown shadow to indicate that it's open". ## Vanilla rule - `TrappedChestBlock.getSignal` = `clamp(ChestBlockEntity.getOpenCount, 0, 15)` (direct signal upwards only); `TrappedChestBlockEntity.signalOpenCount` calls `updateNeighborsAt(pos)` and `updateNeighborsAt(pos.below())` when the count changes. - `BarrelBlockEntity.openersCounter`: `onOpen` → `updateBlockState(state, true)`, `onClose` → `false`: `setBlock(pos, state.setValue(OPEN, …), UPDATE_ALL)`, which swaps the top for `barrel_top_open`. ## Cause Both missing in every mode: the world code asks `LevelAccess::block_entity_signal` for a trapped chest, and `GameLevel` only answered jukeboxes (0 for trapped chests); nothing ever set a barrel's `open`. The opener counting already existed (`lid_openers`, the host and every guest). ## Change - `GameLevel` borrows `lid_openers`; `block_entity_signal` returns the trapped chest's count. - `lid_openers_changed` updates the trapped chest's neighbours and the block below when its count changes. - Barrels count their openers the same way and set `open` when the first opens and the last closes (`set_bool_prop` from crafter.rs, now `pub(crate)`). ## Tested - Server thread and `--in-frame`, survival: a trapped chest with a redstone lamp beside it; opening the chest lights the lamp (`execute if block … redstone_lamp[lit=true]` passes), closing it turns it off. A barrel reads `open=true` while its menu is open and `open=false` once closed. - LAN guests and dedicated servers use the same opener code (`container_openers_changed`). **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at 6a065fa48, 2 min 56 s) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +61 −8 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (5 s) | | clippy | ✅ (6 s) | | tests: horizon-client | ✅ 1236 passed (2 min 26 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 | ➖ 27 affected, to run in CI (--quick): arrow, block_particles, block_removal, breaking_model, command_exec, composter, crafter, dedicated_server, dispenser, enchanting, locator_bar, mace and 15 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | Named harnesses (local): redstone PASS, block_entity_anim PASS. 🤖 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-03 04:12:17 +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#3783
No description provided.