[PR #4721] [MERGED] Test block: block entity, packet, handler and edit screen #5804

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4721
Author: @levzzz5154
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @levzzz5154

Base: main ← Head: parity/A4a-test-block


📝 Commits (2)

  • e017850 Test block: block entity, packet, handler, edit screen
  • 0ec594d Merge remote-tracking branch 'hr/main' into parity/A4a-test-block

📊 Changes

16 files changed (+445 additions, -10 deletions)

View changed files

📝 crates/horizon-client-render/src/chunk/block_entity.rs (+2 -0)
📝 crates/horizon-client-render/src/containers.rs (+10 -0)
📝 crates/horizon-client-render/src/lib.rs (+1 -0)
➕ crates/horizon-client-render/src/test_block.rs (+111 -0)
📝 crates/horizon-client/src/game.rs (+11 -3)
📝 crates/horizon-client/src/game/block_editor.rs (+12 -0)
📝 crates/horizon-client/src/game/lan_actions.rs (+1 -0)
📝 crates/horizon-client/src/game/structure_blocks.rs (+8 -4)
➕ crates/horizon-client/src/game/test_block_edit.rs (+184 -0)
➕ crates/horizon-client/src/game/test_blocks.rs (+78 -0)
📝 crates/horizon-client/src/lan/chunks.rs (+2 -0)
📝 crates/horizon-client/src/lib.rs (+2 -2)
📝 crates/horizon-client/src/save.rs (+2 -0)
📝 crates/horizon-protocol/src/packets/play.rs (+19 -0)
📝 crates/horizon-world/src/level/classes.rs (+1 -0)
📝 crates/horizon-world/src/level/interact.rs (+1 -1)

📄 Description

🤖 Opened by levzzz5154's AI agent (Claude Code, Claude Sonnet 5.5), not by levzzz5154 personally.

Part of #3520, part of #3518 (stage 4a of the structure/jigsaw/test block project: the test block).

What and why

Test blocks had no block entity or editor. Game masters can now use one, set its mode and message, and have it saved.

  • TestBlockEntity (saveAdditional/loadAdditional, getUpdateTag): mode (a missing one is FAIL), message, powered; a placed block takes its state's mode.
  • ServerboundSetTestBlockPacket in horizon-protocol (id 61).
  • ServerGamePacketListenerImpl.handleSetTestBlock (server-thread / LAN guest path): game masters only; TestBlockEntity.setMode also sets the block state's mode; message set; the block is resent.
  • TestBlockEditScreen: vanilla layout (message box hidden for START, mode cycle button, mode info line, Done/Cancel); Enter does nothing, as in vanilla. TestBlock.useWithoutItem opens it for game masters.

The test block's redstone/trigger behaviour is not part of this PR.

Kind

  • parity: Horizon now does what vanilla 26.3 does

Vanilla reference

TestBlockEntity.*, TestBlockMode, ServerboundSetTestBlockPacket, handleSetTestBlock, TestBlock.useWithoutItem, TestBlockEditScreen.

Tests

test_block::tests (save/load, defaults, ids), set_test_block_round_trips, game::test_block_edit tests. fmt and clippy -D warnings clean on horizon-client, horizon-world, horizon-client-render and horizon-protocol.

🤖 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/4721 **Author:** [@levzzz5154](https://github.com/levzzz5154) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `parity/A4a-test-block` --- ### 📝 Commits (2) - [`e017850`](https://github.com/horizon-rust/horizon/commit/e017850f93f969cde05a3ffeaf0e41a489bc661e) Test block: block entity, packet, handler, edit screen - [`0ec594d`](https://github.com/horizon-rust/horizon/commit/0ec594d9d3811bc917ceb3a761be7b80f80be5ba) Merge remote-tracking branch 'hr/main' into parity/A4a-test-block ### 📊 Changes **16 files changed** (+445 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/chunk/block_entity.rs` (+2 -0) 📝 `crates/horizon-client-render/src/containers.rs` (+10 -0) 📝 `crates/horizon-client-render/src/lib.rs` (+1 -0) ➕ `crates/horizon-client-render/src/test_block.rs` (+111 -0) 📝 `crates/horizon-client/src/game.rs` (+11 -3) 📝 `crates/horizon-client/src/game/block_editor.rs` (+12 -0) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+1 -0) 📝 `crates/horizon-client/src/game/structure_blocks.rs` (+8 -4) ➕ `crates/horizon-client/src/game/test_block_edit.rs` (+184 -0) ➕ `crates/horizon-client/src/game/test_blocks.rs` (+78 -0) 📝 `crates/horizon-client/src/lan/chunks.rs` (+2 -0) 📝 `crates/horizon-client/src/lib.rs` (+2 -2) 📝 `crates/horizon-client/src/save.rs` (+2 -0) 📝 `crates/horizon-protocol/src/packets/play.rs` (+19 -0) 📝 `crates/horizon-world/src/level/classes.rs` (+1 -0) 📝 `crates/horizon-world/src/level/interact.rs` (+1 -1) </details> ### 📄 Description > 🤖 Opened by levzzz5154's AI agent (Claude Code, Claude Sonnet 5.5), not by levzzz5154 personally. Part of #3520, part of #3518 (stage 4a of the structure/jigsaw/test block project: the test block). ## What and why Test blocks had no block entity or editor. Game masters can now use one, set its mode and message, and have it saved. - `TestBlockEntity` (`saveAdditional`/`loadAdditional`, `getUpdateTag`): mode (a missing one is FAIL), message, powered; a placed block takes its state's mode. - `ServerboundSetTestBlockPacket` in horizon-protocol (id 61). - `ServerGamePacketListenerImpl.handleSetTestBlock` (server-thread / LAN guest path): game masters only; `TestBlockEntity.setMode` also sets the block state's `mode`; message set; the block is resent. - `TestBlockEditScreen`: vanilla layout (message box hidden for START, mode cycle button, mode info line, Done/Cancel); Enter does nothing, as in vanilla. `TestBlock.useWithoutItem` opens it for game masters. The test block's redstone/trigger behaviour is not part of this PR. ## Kind - [x] parity: Horizon now does what vanilla 26.3 does ## Vanilla reference `TestBlockEntity.*`, `TestBlockMode`, `ServerboundSetTestBlockPacket`, `handleSetTestBlock`, `TestBlock.useWithoutItem`, `TestBlockEditScreen`. ## Tests `test_block::tests` (save/load, defaults, ids), `set_test_block_round_trips`, `game::test_block_edit` tests. fmt and clippy `-D warnings` clean on horizon-client, horizon-world, horizon-client-render and horizon-protocol. 🤖 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 05:15:07 +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#5804
No description provided.