[PR #2075] [MERGED] Structures: save jigsaw starts as StructureStart.createTag does #3986

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

📋 Pull Request Information

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

Base: main ← Head: fix/structure-starts-1-jigsaw


📝 Commits (1)

  • c776d65 Structures: save jigsaw starts as StructureStart.createTag does

📊 Changes

13 files changed (+427 additions, -3 deletions)

View changed files

📝 crates/horizon-world/examples/probe/main.rs (+2 -0)
📝 crates/horizon-world/examples/probe/structure_pieces.rs (+1 -1)
➕ crates/horizon-world/examples/probe/structure_start_nbt.rs (+74 -0)
📝 crates/horizon-world/src/level/mod.rs (+1 -0)
📝 crates/horizon-world/src/worldgen/structure.rs (+19 -0)
📝 crates/horizon-world/src/worldgen/structure/enhanced_terrain.rs (+3 -0)
📝 crates/horizon-world/src/worldgen/structure/jigsaw.rs (+128 -0)
📝 crates/horizon-world/src/worldgen/structure/legacy.rs (+30 -0)
📝 crates/horizon-world/src/worldgen/structure/piece_limited.rs (+11 -0)
📝 crates/horizon-world/src/worldgen/structure/processor.rs (+1 -1)
📝 crates/horizon-world/src/worldgen/structure/start.rs (+27 -0)
📝 mods/horizon/src/test/java/dev/horizonlab/parity/VanillaStructureStartOracle.java (+38 -1)
➕ tools/test_structure_start_nbt_parity.py (+92 -0)

📄 Description

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

What and why

Horizon kept no saveable form of its structure starts. Its saves carry an empty structures.starts, so every structure it generates is invisible to vanilla and Paper:

  • /locate structure and /locate maps do not find it,
  • structure mob spawns stop (witch huts, ocean monuments, fortresses, pillager outposts),
  • location_check predicates and advancements that key on a structure do not fire,
  • a structure crossing the edge of the generated area is not continued in the chunks vanilla generates next.

This is a stack of four PRs, each under 500 lines:

  1. jigsaw starts: #2075
  2. template pieces: #2076
  3. the remaining legacy pieces: #2077
  4. chunks write the starts they hold: #2078

GitHub does not let a fork stack PRs on each other's branches, so each PR targets main and contains the ones before it. Only the last commit is new in each.

This PR (1/4): jigsaw starts. StructureStart::save and Piece::save write the tag StructureStart.createTag writes. This covers the pieces of jigsaw pools: villages, pillager outposts, ancient cities, trail ruins, trial chambers and bastions. Each piece saves:

  • its pool element,
  • its junctions, with delta_y and dest_proj,
  • its liquid settings,
  • its processors as the pool wrote them.

PoolPiece::from_saved reads delta_y and dest_proj back. LegacyPiece::save defaults to None, and a start with such a piece is not saved, as before. Nothing writes the tags yet; that is PR 4.

Vanilla reference

  • StructureStart.createTag, StructurePiece.createTag
  • PoolElementStructurePiece.addAdditionalSaveData
  • JigsawJunction.serialize
  • StructurePoolElement.CODEC (single, legacy, list, feature, empty)
  • LiquidSettings

Tests

  • New harness tools/test_structure_start_nbt_parity.py with the probe examples/probe/structure_start_nbt.rs. For one site of every jigsaw structure kind, a Java oracle on the pinned 26.3 server generates the start and prints createTag. Horizon generates the same start and prints save. The tags must be equal.
  • On this commit: 13 structure starts save as vanilla.

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main on 0d04bff7d754, against upstream/main at 57c5f8129, 2 min 47 s)

Check Result
Scope ✅ 13 files, +427 −3
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 306 passed (22 s)
rustfmt ✅ (6 s)
clippy ✅ (38 s)
tests: horizon-world ✅ 236 passed (1 min 38 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 ➖ 337 affected, to run in CI (--quick): active_effect_tick, active_effects, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, auto_jump, bamboo, basic_feature, biome_chunk and 325 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 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/2075 **Author:** [@FusselTV](https://github.com/FusselTV) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/structure-starts-1-jigsaw` --- ### 📝 Commits (1) - [`c776d65`](https://github.com/horizon-rust/horizon/commit/c776d6586e24b7a09fdfe9ea2b3856575f241be7) Structures: save jigsaw starts as StructureStart.createTag does ### 📊 Changes **13 files changed** (+427 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-world/examples/probe/main.rs` (+2 -0) 📝 `crates/horizon-world/examples/probe/structure_pieces.rs` (+1 -1) ➕ `crates/horizon-world/examples/probe/structure_start_nbt.rs` (+74 -0) 📝 `crates/horizon-world/src/level/mod.rs` (+1 -0) 📝 `crates/horizon-world/src/worldgen/structure.rs` (+19 -0) 📝 `crates/horizon-world/src/worldgen/structure/enhanced_terrain.rs` (+3 -0) 📝 `crates/horizon-world/src/worldgen/structure/jigsaw.rs` (+128 -0) 📝 `crates/horizon-world/src/worldgen/structure/legacy.rs` (+30 -0) 📝 `crates/horizon-world/src/worldgen/structure/piece_limited.rs` (+11 -0) 📝 `crates/horizon-world/src/worldgen/structure/processor.rs` (+1 -1) 📝 `crates/horizon-world/src/worldgen/structure/start.rs` (+27 -0) 📝 `mods/horizon/src/test/java/dev/horizonlab/parity/VanillaStructureStartOracle.java` (+38 -1) ➕ `tools/test_structure_start_nbt_parity.py` (+92 -0) </details> ### 📄 Description > 🤖 Opened by FusselTV's AI agent (Claude Code, Opus 5.5), not by FusselTV personally. ## What and why Horizon kept no saveable form of its structure starts. Its saves carry an empty `structures.starts`, so every structure it generates is invisible to vanilla and Paper: - `/locate structure` and `/locate` maps do not find it, - structure mob spawns stop (witch huts, ocean monuments, fortresses, pillager outposts), - `location_check` predicates and advancements that key on a structure do not fire, - a structure crossing the edge of the generated area is not continued in the chunks vanilla generates next. This is a stack of four PRs, each under 500 lines: 1. jigsaw starts: #2075 2. template pieces: #2076 3. the remaining legacy pieces: #2077 4. chunks write the starts they hold: #2078 GitHub does not let a fork stack PRs on each other's branches, so each PR targets `main` and contains the ones before it. Only the last commit is new in each. **This PR (1/4): jigsaw starts.** `StructureStart::save` and `Piece::save` write the tag `StructureStart.createTag` writes. This covers the pieces of jigsaw pools: villages, pillager outposts, ancient cities, trail ruins, trial chambers and bastions. Each piece saves: - its pool element, - its junctions, with `delta_y` and `dest_proj`, - its liquid settings, - its processors as the pool wrote them. `PoolPiece::from_saved` reads `delta_y` and `dest_proj` back. `LegacyPiece::save` defaults to `None`, and a start with such a piece is not saved, as before. Nothing writes the tags yet; that is PR 4. ## Vanilla reference - `StructureStart.createTag`, `StructurePiece.createTag` - `PoolElementStructurePiece.addAdditionalSaveData` - `JigsawJunction.serialize` - `StructurePoolElement.CODEC` (single, legacy, list, feature, empty) - `LiquidSettings` ## Tests - New harness `tools/test_structure_start_nbt_parity.py` with the probe `examples/probe/structure_start_nbt.rs`. For one site of every jigsaw structure kind, a Java oracle on the pinned 26.3 server generates the start and prints `createTag`. Horizon generates the same start and prints `save`. The tags must be equal. - On this commit: 13 structure starts save as vanilla. ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on 0d04bff7d754, against upstream/main at 57c5f8129, 2 min 47 s) | Check | Result | | --- | --- | | Scope | ✅ 13 files, +427 −3 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 306 passed (22 s) | | rustfmt | ✅ (6 s) | | clippy | ✅ (38 s) | | tests: horizon-world | ✅ 236 passed (1 min 38 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 | ➖ 337 affected, to run in CI (--quick): active_effect_tick, active_effects, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, auto_jump, bamboo, basic_feature, biome_chunk and 325 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 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:13:48 +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#3986
No description provided.