[PR #4716] [MERGED] Jigsaw block: block entity, packets, handlers and edit screen #5801

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

📋 Pull Request Information

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

Base: main ← Head: parity/A3-jigsaw


📝 Commits (2)

  • ceb5791 Jigsaw block: block entity, packets, handlers, edit screen
  • c4c4b63 Merge remote-tracking branch 'hr/main' into parity/A3-jigsaw

📊 Changes

17 files changed (+797 additions, -16 deletions)

View changed files

📝 crates/horizon-client-render/src/chunk/block_entity.rs (+2 -0)
📝 crates/horizon-client-render/src/containers.rs (+7 -0)
➕ crates/horizon-client-render/src/jigsaw_block.rs (+153 -0)
📝 crates/horizon-client-render/src/lib.rs (+1 -0)
📝 crates/horizon-client/src/game.rs (+14 -3)
📝 crates/horizon-client/src/game/block_editor.rs (+72 -3)
📝 crates/horizon-client/src/game/commands/place.rs (+1 -1)
➕ crates/horizon-client/src/game/jigsaw_blocks.rs (+138 -0)
➕ crates/horizon-client/src/game/jigsaw_edit.rs (+331 -0)
📝 crates/horizon-client/src/game/lan_actions.rs (+2 -0)
📝 crates/horizon-client/src/lan/chunks.rs (+2 -0)
📝 crates/horizon-client/src/lib.rs (+7 -7)
📝 crates/horizon-client/src/save.rs (+8 -0)
📝 crates/horizon-protocol/src/packets/play.rs (+47 -0)
📝 crates/horizon-world/src/level/growth.rs (+3 -1)
📝 crates/horizon-world/src/worldgen/structure/jigsaw.rs (+8 -1)
📝 crates/horizon-world/src/worldgen/structure/start.rs (+1 -0)

📄 Description

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

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

What and why

Jigsaw blocks had no block entity, so their name, pool, target and joint were lost on load, and the edit screen and its two packets did not exist.

  • JigsawBlockEntity (saveAdditional/loadAdditional, getUpdateTag): name, target, pool, joint, final state, priorities; the joint a new block starts with follows its facing (StructureTemplate.getDefaultJointType).
  • ServerboundSetJigsawBlockPacket and ServerboundJigsawGeneratePacket in horizon-protocol (ids 59 and 27, vanilla's field order).
  • ServerGamePacketListenerImpl.handleSetJigsawBlock, handleJigsawGenerate (server-thread / LAN guest path): game masters only; Generate runs JigsawBlockEntity.generate (front neighbour, pool lookup, JigsawPlacement.generateJigsaw) through Horizon's existing jigsaw assembly, now honouring keepJigsaws (SinglePoolElement.getSettings skips the jigsaw replacement; worldgen and /place jigsaw pass false).
  • JigsawBlockEditScreen: vanilla layout and lang keys, identifier validity for Done/Generate, the joint cycle only on vertical blocks, the levels slider (0..20) and keep-jigsaws toggle, Generate sending the block then the generate packet. The shared edit-screen runner gained a slider widget and multi-packet sends.
  • JigsawBlock.useWithoutItem already reports the open effect for game masters; the server's menu opener now leaves it to the client.

Not ported: the priority boxes' hover tooltips.

Kind

  • parity: Horizon now does what vanilla 26.3 does

Vanilla reference

JigsawBlockEntity.*, ServerboundSetJigsawBlockPacket, ServerboundJigsawGeneratePacket, handleSetJigsawBlock, handleJigsawGenerate, JigsawPlacement.generateJigsaw, SinglePoolElement.getSettings, JigsawBlockEditScreen.

Tests

jigsaw_block::tests (save/load round trip, defaults), jigsaw_packets_round_trip, game::jigsaw_edit tests (values sent, validity, generate sequence, slider range). 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/4716 **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/A3-jigsaw` --- ### 📝 Commits (2) - [`ceb5791`](https://github.com/horizon-rust/horizon/commit/ceb5791a69bbbaf529a8e0cb8cec25cffe25fa8a) Jigsaw block: block entity, packets, handlers, edit screen - [`c4c4b63`](https://github.com/horizon-rust/horizon/commit/c4c4b63abad9485b7ec4053d60daa7121c0efbd4) Merge remote-tracking branch 'hr/main' into parity/A3-jigsaw ### 📊 Changes **17 files changed** (+797 additions, -16 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` (+7 -0) ➕ `crates/horizon-client-render/src/jigsaw_block.rs` (+153 -0) 📝 `crates/horizon-client-render/src/lib.rs` (+1 -0) 📝 `crates/horizon-client/src/game.rs` (+14 -3) 📝 `crates/horizon-client/src/game/block_editor.rs` (+72 -3) 📝 `crates/horizon-client/src/game/commands/place.rs` (+1 -1) ➕ `crates/horizon-client/src/game/jigsaw_blocks.rs` (+138 -0) ➕ `crates/horizon-client/src/game/jigsaw_edit.rs` (+331 -0) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+2 -0) 📝 `crates/horizon-client/src/lan/chunks.rs` (+2 -0) 📝 `crates/horizon-client/src/lib.rs` (+7 -7) 📝 `crates/horizon-client/src/save.rs` (+8 -0) 📝 `crates/horizon-protocol/src/packets/play.rs` (+47 -0) 📝 `crates/horizon-world/src/level/growth.rs` (+3 -1) 📝 `crates/horizon-world/src/worldgen/structure/jigsaw.rs` (+8 -1) 📝 `crates/horizon-world/src/worldgen/structure/start.rs` (+1 -0) </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 3 of the structure/jigsaw/test block project: the jigsaw block). ## What and why Jigsaw blocks had no block entity, so their name, pool, target and joint were lost on load, and the edit screen and its two packets did not exist. - `JigsawBlockEntity` (`saveAdditional`/`loadAdditional`, `getUpdateTag`): name, target, pool, joint, final state, priorities; the joint a new block starts with follows its facing (`StructureTemplate.getDefaultJointType`). - `ServerboundSetJigsawBlockPacket` and `ServerboundJigsawGeneratePacket` in horizon-protocol (ids 59 and 27, vanilla's field order). - `ServerGamePacketListenerImpl.handleSetJigsawBlock`, `handleJigsawGenerate` (server-thread / LAN guest path): game masters only; Generate runs `JigsawBlockEntity.generate` (front neighbour, pool lookup, `JigsawPlacement.generateJigsaw`) through Horizon's existing jigsaw assembly, now honouring `keepJigsaws` (`SinglePoolElement.getSettings` skips the jigsaw replacement; worldgen and `/place jigsaw` pass `false`). - `JigsawBlockEditScreen`: vanilla layout and lang keys, identifier validity for Done/Generate, the joint cycle only on vertical blocks, the levels slider (0..20) and keep-jigsaws toggle, Generate sending the block then the generate packet. The shared edit-screen runner gained a slider widget and multi-packet sends. - `JigsawBlock.useWithoutItem` already reports the open effect for game masters; the server's menu opener now leaves it to the client. Not ported: the priority boxes' hover tooltips. ## Kind - [x] parity: Horizon now does what vanilla 26.3 does ## Vanilla reference `JigsawBlockEntity.*`, `ServerboundSetJigsawBlockPacket`, `ServerboundJigsawGeneratePacket`, `handleSetJigsawBlock`, `handleJigsawGenerate`, `JigsawPlacement.generateJigsaw`, `SinglePoolElement.getSettings`, `JigsawBlockEditScreen`. ## Tests `jigsaw_block::tests` (save/load round trip, defaults), `jigsaw_packets_round_trip`, `game::jigsaw_edit` tests (values sent, validity, generate sequence, slider range). 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:06 +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#5801
No description provided.