[PR #7342] [MERGED] port map: rest-012's jigsaw, structure block and command minecart packets exist #7507

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7342
Author: @MSedgeMC
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: chore/vol-e-rest-012


📝 Commits (2)

  • e2d757b Port map: three serverbound block-edit packets Horizon does write
  • a5a3c96 Port map: the structure block's constructor and write, and the cart getCommandBlock

📊 Changes

1 file changed (+6 additions, -6 deletions)

View changed files

📝 tools/port_map/rest-012.tsv (+6 -6)

📄 Description

Rows of tools/port_map/rest-012.tsv (149 rows, map-check clean against 26.3). Five rows said "no such packet / no screen in the client" for packets Horizon both writes and answers; the sixth, ServerboundSeenAdvancementsPacket.write, really is unported and stays missing.

Verdicts

row was now where
ServerboundJigsawGeneratePacket.write missing port crates/horizon-protocol/src/buf.rs::write
ServerboundSetJigsawBlockPacket.write missing port crates/horizon-protocol/src/buf.rs::write
ServerboundSetCommandMinecartPacket.write missing port crates/horizon-protocol/src/buf.rs::write
ServerboundSetCommandMinecartPacket.getCommandBlock missing inline crates/horizon-client/src/game/command_minecarts.rs::Game::apply_cart_command
ServerboundSetStructureBlockPacket.<init> missing port crates/horizon-client/src/game/structure_edit.rs::StructureEditor::packet
ServerboundSetStructureBlockPacket.write missing port crates/horizon-protocol/src/packets/play.rs::SetStructureBlock::write

The three serverbound block-edit writes

  • JigsawGenerate {pos Pos, levels VarInt, keep_jigsaws Bool} (crates/horizon-protocol/src/packets/play.rs:2344), built by the jigsaw screen's Generate button in game/jigsaw_edit.rs::JigsawEditor::generate_packet (jigsaw_edit.rs:101) and answered by Game::generate_jigsaw_block (game/jigsaw_blocks.rs:101).
  • SetJigsawBlock (play.rs:2296-2309), the eight fields in vanilla's order, built by JigsawEditor::set_packet (jigsaw_edit.rs:87) and answered by Game::apply_set_jigsaw_block (jigsaw_blocks.rs:65).
  • SetCommandMinecart {entity VarInt, command Str, track_output Bool} (play.rs:2353-2356), sent by Game::set_command_minecart (game/command_minecarts.rs:126) and answered by Game::lan_set_command_minecart (command_minecarts.rs:151).

Each is a packet! definition, so the where cell names buf.rs::write the way the file's other packet! rows do. The field list in the note is the definition itself.

SetStructureBlock is hand-written rather than a packet! (play.rs:2357-2463), so its write is named directly: pos, update type and mode, the name, each offset and size as a byte, mirror and rotation, data, integrity, seed, then the four flags in one byte (play.rs:2424).

ServerboundSetCommandMinecartPacket.getCommandBlock is inline rather than port: Game::apply_cart_command (command_minecarts.rs:172) sets the cart's command and track-output flag — what getCommandBlock returns — and handleSetCommandMinecart's onUpdated and chat note follow in the same fn.

ServerboundSetStructureBlockPacket.<init> is the (StructureBlockEntity, UpdateType) constructor. StructureEditor::packet (game/structure_edit.rs:110) builds the same packet from the screen's edit boxes and the block's own mode, mirror, rotation and flags; the guest side applies it with the ordinals checked in Game::apply_set_structure_block (game/structure_blocks.rs:586).

Checked and left alone

  • ServerboundSeenAdvancementsPacket.write: ids.rs:482 has the id, and nothing under crates/ writes or reads seen_advancements. The advancement screen sends no select-tab message. Still missing.
  • The file's other missing rows (ProtocolInfoBuilder.withBundlePacket, DiscardedPayload.codec, ClientboundCommandsPacket.validateEntries, VecDelta.Stepped.tryEncode, ClientIntent.byId and the two readUnknownPayload caps) are untouched: this pass found no code that does their job.

Map-check:

PORT_LEDGER_OUT=/tmp/led-volE python3 tools/port_ledger.py map-check tools/port_map/rest-012.tsv
149 rows, no problems.

Proven: the wire layouts, from the round-trip tests that check the bytes rather than the shape: set_command_minecart_writes_entity_command_then_track_output (play.rs:3773) asserts [0xAC, 0x02, 6, 's','a','y',' ','h','i', 1] — VarInt, UTF, boolean — jigsaw_packets_round_trip (play.rs:3897) round-trips both jigsaw packets, and set_structure_block_round_trips_and_clamps_like_vanilla (play.rs:3791) checks the flag byte 1|2|4 and the ±48/0..=48/0..=1 clamps. The client-side rows are read at the cite: JigsawEditor::set_packet/generate_packet, StructureEditor::packet, Game::set_command_minecart → apply_cart_command, and the three guest handlers. Every where cell resolves under map-check.

Not proven: that a real client reaches every one of these paths — the jigsaw, structure-block and command-minecart screens need the block in the world, a creative player at game-master level, and a remote server, none of which I ran. StructureEditor::packet also keeps data in the screen instead of the block entity, so the constructor's snapshot and the Rust builder split the same fields differently; the packet they produce is the same.


🔄 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/7342 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `chore/vol-e-rest-012` --- ### 📝 Commits (2) - [`e2d757b`](https://github.com/horizon-rust/horizon/commit/e2d757b741c2e5340d445cb396a0657c7c007a50) Port map: three serverbound block-edit packets Horizon does write - [`a5a3c96`](https://github.com/horizon-rust/horizon/commit/a5a3c96e4a6cfad0981f11856c92b3e5c257a5ec) Port map: the structure block's constructor and write, and the cart getCommandBlock ### 📊 Changes **1 file changed** (+6 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `tools/port_map/rest-012.tsv` (+6 -6) </details> ### 📄 Description Rows of `tools/port_map/rest-012.tsv` (149 rows, map-check clean against 26.3). Five rows said "no such packet / no screen in the client" for packets Horizon both writes and answers; the sixth, `ServerboundSeenAdvancementsPacket.write`, really is unported and stays `missing`. **Verdicts** | row | was | now | where | | --- | --- | --- | --- | | `ServerboundJigsawGeneratePacket.write` | missing | port | `crates/horizon-protocol/src/buf.rs::write` | | `ServerboundSetJigsawBlockPacket.write` | missing | port | `crates/horizon-protocol/src/buf.rs::write` | | `ServerboundSetCommandMinecartPacket.write` | missing | port | `crates/horizon-protocol/src/buf.rs::write` | | `ServerboundSetCommandMinecartPacket.getCommandBlock` | missing | inline | `crates/horizon-client/src/game/command_minecarts.rs::Game::apply_cart_command` | | `ServerboundSetStructureBlockPacket.<init>` | missing | port | `crates/horizon-client/src/game/structure_edit.rs::StructureEditor::packet` | | `ServerboundSetStructureBlockPacket.write` | missing | port | `crates/horizon-protocol/src/packets/play.rs::SetStructureBlock::write` | **The three serverbound block-edit writes** - `JigsawGenerate {pos Pos, levels VarInt, keep_jigsaws Bool}` (`crates/horizon-protocol/src/packets/play.rs:2344`), built by the jigsaw screen's Generate button in `game/jigsaw_edit.rs::JigsawEditor::generate_packet` (jigsaw_edit.rs:101) and answered by `Game::generate_jigsaw_block` (game/jigsaw_blocks.rs:101). - `SetJigsawBlock` (`play.rs:2296-2309`), the eight fields in vanilla's order, built by `JigsawEditor::set_packet` (jigsaw_edit.rs:87) and answered by `Game::apply_set_jigsaw_block` (jigsaw_blocks.rs:65). - `SetCommandMinecart {entity VarInt, command Str, track_output Bool}` (`play.rs:2353-2356`), sent by `Game::set_command_minecart` (game/command_minecarts.rs:126) and answered by `Game::lan_set_command_minecart` (command_minecarts.rs:151). Each is a `packet!` definition, so the `where` cell names `buf.rs::write` the way the file's other `packet!` rows do. The field list in the note is the definition itself. `SetStructureBlock` is hand-written rather than a `packet!` (`play.rs:2357-2463`), so its `write` is named directly: pos, update type and mode, the name, each offset and size as a byte, mirror and rotation, data, integrity, seed, then the four flags in one byte (`play.rs:2424`). `ServerboundSetCommandMinecartPacket.getCommandBlock` is `inline` rather than `port`: `Game::apply_cart_command` (command_minecarts.rs:172) sets the cart's command and track-output flag — what `getCommandBlock` returns — and `handleSetCommandMinecart`'s `onUpdated` and chat note follow in the same fn. `ServerboundSetStructureBlockPacket.<init>` is the `(StructureBlockEntity, UpdateType)` constructor. `StructureEditor::packet` (game/structure_edit.rs:110) builds the same packet from the screen's edit boxes and the block's own mode, mirror, rotation and flags; the guest side applies it with the ordinals checked in `Game::apply_set_structure_block` (game/structure_blocks.rs:586). **Checked and left alone** - `ServerboundSeenAdvancementsPacket.write`: `ids.rs:482` has the id, and nothing under `crates/` writes or reads `seen_advancements`. The advancement screen sends no select-tab message. Still `missing`. - The file's other `missing` rows (`ProtocolInfoBuilder.withBundlePacket`, `DiscardedPayload.codec`, `ClientboundCommandsPacket.validateEntries`, `VecDelta.Stepped.tryEncode`, `ClientIntent.byId` and the two `readUnknownPayload` caps) are untouched: this pass found no code that does their job. Map-check: ``` PORT_LEDGER_OUT=/tmp/led-volE python3 tools/port_ledger.py map-check tools/port_map/rest-012.tsv 149 rows, no problems. ``` **Proven:** the wire layouts, from the round-trip tests that check the bytes rather than the shape: `set_command_minecart_writes_entity_command_then_track_output` (`play.rs:3773`) asserts `[0xAC, 0x02, 6, 's','a','y',' ','h','i', 1]` — VarInt, UTF, boolean — `jigsaw_packets_round_trip` (`play.rs:3897`) round-trips both jigsaw packets, and `set_structure_block_round_trips_and_clamps_like_vanilla` (`play.rs:3791`) checks the flag byte `1|2|4` and the `±48`/`0..=48`/`0..=1` clamps. The client-side rows are read at the cite: `JigsawEditor::set_packet`/`generate_packet`, `StructureEditor::packet`, `Game::set_command_minecart` → `apply_cart_command`, and the three guest handlers. Every `where` cell resolves under map-check. **Not proven:** that a real client reaches every one of these paths — the jigsaw, structure-block and command-minecart screens need the block in the world, a creative player at game-master level, and a remote server, none of which I ran. `StructureEditor::packet` also keeps `data` in the screen instead of the block entity, so the constructor's snapshot and the Rust builder split the same fields differently; the packet they produce is the same. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:40:16 +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#7507
No description provided.