[PR #2380] [MERGED] Let a comparator read an item frame through a block #4261

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

📋 Pull Request Information

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

Base: main ← Head: fix/comparator-reads-item-frame


📝 Commits (2)

  • 8c0ed0e Let a comparator read an item frame through a block
  • d25648f Merge main into fix/comparator-reads-item-frame

📊 Changes

4 files changed (+45 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+17 -0)
📝 crates/horizon-client/src/game/frames.rs (+14 -0)
📝 crates/horizon-world/src/level/mod.rs (+6 -0)
📝 crates/horizon-world/src/level/redstone.rs (+8 -2)

📄 Description

What and why

A comparator pointing at a solid block with an item frame on its far side never read the frame. In vanilla this is the classic item-frame signal: an empty frame gives 0, and a frame with an item gives its rotation (0 to 7) plus 1.

The comparator input now looks one block past the conductor for exactly one frame facing the same way as the comparator, and takes the larger of the frame and a block-entity signal there. Putting an item in, rotating it, or taking it out (or the frame breaking with an item) now updates the comparators around it, like updateNeighbourForOutputSignal does in vanilla.

The frame lookup is a new LevelAccess::item_frame_analog_output with a default of "none", implemented by the game level over its item frames, so it works for the window's own frames and the server-thread path alike.

Vanilla reference

  • ComparatorBlock.getInputSignal and getItemFrame
  • ItemFrame.getAnalogOutput, setItem and setRotation (updateNeighbourForOutputSignal)

Self-check

cargo check -p horizon-client passes.


🔄 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/2380 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/comparator-reads-item-frame` --- ### 📝 Commits (2) - [`8c0ed0e`](https://github.com/horizon-rust/horizon/commit/8c0ed0e591d7abe2d5a971ad8e6929c37283666b) Let a comparator read an item frame through a block - [`d25648f`](https://github.com/horizon-rust/horizon/commit/d25648f729bb078435e0cea169121bf798ffc89d) Merge main into fix/comparator-reads-item-frame ### 📊 Changes **4 files changed** (+45 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+17 -0) 📝 `crates/horizon-client/src/game/frames.rs` (+14 -0) 📝 `crates/horizon-world/src/level/mod.rs` (+6 -0) 📝 `crates/horizon-world/src/level/redstone.rs` (+8 -2) </details> ### 📄 Description ## What and why A comparator pointing at a solid block with an item frame on its far side never read the frame. In vanilla this is the classic item-frame signal: an empty frame gives 0, and a frame with an item gives its rotation (0 to 7) plus 1. The comparator input now looks one block past the conductor for exactly one frame facing the same way as the comparator, and takes the larger of the frame and a block-entity signal there. Putting an item in, rotating it, or taking it out (or the frame breaking with an item) now updates the comparators around it, like `updateNeighbourForOutputSignal` does in vanilla. The frame lookup is a new `LevelAccess::item_frame_analog_output` with a default of "none", implemented by the game level over its item frames, so it works for the window's own frames and the server-thread path alike. ## Vanilla reference - `ComparatorBlock.getInputSignal` and `getItemFrame` - `ItemFrame.getAnalogOutput`, `setItem` and `setRotation` (`updateNeighbourForOutputSignal`) ## Self-check `cargo check -p horizon-client` passes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:15:53 +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#4261
No description provided.