[PR #832] [MERGED] Content mods: add to other structure sets and pools (horizon:add_to) #2843

Closed
opened 2026-11-02 15:59:30 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: feat/mod-structure-set-additions


📝 Commits (1)

  • 1ccc41c Content mods: add to other structure sets and pools (horizon:add_to)

📊 Changes

3 files changed (+144 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/mod_content.rs (+85 -2)
📝 crates/horizon-client/src/mod_content_tests.rs (+43 -0)
📝 docs/mods.md (+16 -0)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

What

A content mod can now add to structure sets and template pools that are not its own (vanilla's villages, another mod's house pool). It ships a set or pool file in its own namespace holding horizon:add_to, a key vanilla data never has:

{ "horizon:add_to": "minecraft:villages",
  "structures": [ { "structure": "ctov:small/village_beach", "weight": 10 } ] }

A pool addition holds "elements" as a pool does. When the content root is built (horizon_client::mod_content::build), the entries are appended to each set or pool named, after every mod's own files, in mod and file order. The addition file is not a set or pool of its own. A name nobody defines is skipped, the same way a tag entry naming an unknown id is.

Why

Packs add to vanilla's sets and pools in code: ChoiceTheorem's Overhauled Village puts its 63 villages and 11 outposts into vanilla's villages and pillager_outposts sets through lithostitched's add_structure_set_entries, and many mods add houses to vanilla's village pools with add_template_pool_elements. A content mod had no way to do this, so none of CTOV's villages ever started. The carry side, which writes these files from lithostitched's modifiers and CTOV's Java code, is the next PR (independent of this one; it has no effect without it).

The worldgen loader is unchanged: it reads plain vanilla-shaped sets and pools. With no content mods the root is the base root, as before.

Measured (with the carry PR, ATM10's 42 carried mods, seed 1234, chunks -64..63, chunkgen_bench --starts)

CTOV starts (pieces) vanilla starts (pieces) all starts (pieces)
before 0 (0) 150 (14,163) 286 (15,097)
after 7 (645) 146 (13,688) 289 (15,267)

The four plains villages in the square are now CTOV villages: the set picks among vanilla's 5 entries (weight 1 each) and CTOV's 63 (weights 10/4/1). CTOV villages also start in 3 more places, where only one of its 21 biome types fits. The other mods are unchanged.

Self-check

  • cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings: clean
  • cargo test -p horizon-client --lib mod_content: 12 passed. content_root_carries_a_structure_mod now also adds to minecraft:villages and minecraft:village/plains/houses: each gets the mod's entry at the end, there is no set or pool named after the addition file, and an unknown target is skipped. The structure still locates through the worldgen loader.
  • Parity: all 304 harnesses that depend on the changed files pass on one integration of this agent's PRs (#832, #833, #838, #839, #840, #846, #847, #850, #851 merged onto origin/main at 845a122f): 298 run (298 passed, 0 failed in 82.4 min), 6 already passing for the same inputs. The vanilla structure-start oracle stays at 35/35.

Docs: docs/mods.md (content mods) documents the key.

Nothing here needs Ludovic.

🤖 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/832 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/18/2026 **Status:** ✅ Merged **Merged:** 10/18/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/mod-structure-set-additions` --- ### 📝 Commits (1) - [`1ccc41c`](https://github.com/horizon-rust/horizon/commit/1ccc41c8b29cb2034d6e1bed1662665f58fd093c) Content mods: add to other structure sets and pools (horizon:add_to) ### 📊 Changes **3 files changed** (+144 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mod_content.rs` (+85 -2) 📝 `crates/horizon-client/src/mod_content_tests.rs` (+43 -0) 📝 `docs/mods.md` (+16 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What A content mod can now add to structure sets and template pools that are not its own (vanilla's `villages`, another mod's house pool). It ships a set or pool file in its own namespace holding `horizon:add_to`, a key vanilla data never has: ```json { "horizon:add_to": "minecraft:villages", "structures": [ { "structure": "ctov:small/village_beach", "weight": 10 } ] } ``` A pool addition holds `"elements"` as a pool does. When the content root is built (`horizon_client::mod_content::build`), the entries are appended to each set or pool named, after every mod's own files, in mod and file order. The addition file is not a set or pool of its own. A name nobody defines is skipped, the same way a tag entry naming an unknown id is. ## Why Packs add to vanilla's sets and pools in code: ChoiceTheorem's Overhauled Village puts its 63 villages and 11 outposts into vanilla's `villages` and `pillager_outposts` sets through lithostitched's `add_structure_set_entries`, and many mods add houses to vanilla's village pools with `add_template_pool_elements`. A content mod had no way to do this, so none of CTOV's villages ever started. The carry side, which writes these files from lithostitched's modifiers and CTOV's Java code, is the next PR (independent of this one; it has no effect without it). The worldgen loader is unchanged: it reads plain vanilla-shaped sets and pools. With no content mods the root is the base root, as before. ## Measured (with the carry PR, ATM10's 42 carried mods, seed 1234, chunks -64..63, `chunkgen_bench --starts`) | | CTOV starts (pieces) | vanilla starts (pieces) | all starts (pieces) | |---|---:|---:|---:| | before | 0 (0) | 150 (14,163) | 286 (15,097) | | after | 7 (645) | 146 (13,688) | 289 (15,267) | The four plains villages in the square are now CTOV villages: the set picks among vanilla's 5 entries (weight 1 each) and CTOV's 63 (weights 10/4/1). CTOV villages also start in 3 more places, where only one of its 21 biome types fits. The other mods are unchanged. ## Self-check - `cargo fmt --all --check`, `cargo clippy --workspace --all-targets -- -D warnings`: clean - `cargo test -p horizon-client --lib mod_content`: 12 passed. `content_root_carries_a_structure_mod` now also adds to `minecraft:villages` and `minecraft:village/plains/houses`: each gets the mod's entry at the end, there is no set or pool named after the addition file, and an unknown target is skipped. The structure still locates through the worldgen loader. - Parity: all 304 harnesses that depend on the changed files pass on one integration of this agent's PRs (#832, #833, #838, #839, #840, #846, #847, #850, #851 merged onto origin/main at 845a122f): 298 run (298 passed, 0 failed in 82.4 min), 6 already passing for the same inputs. The vanilla structure-start oracle stays at 35/35. Docs: `docs/mods.md` (content mods) documents the key. Nothing here needs Ludovic. 🤖 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-02 15:59:31 +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#2843
No description provided.