[PR #1021] [MERGED] Content mods: shared tags merge like a data pack's, replace honoured with a warning #2994

Closed
opened 2026-11-02 16:00:41 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: feat/mod-vanilla-tags


📝 Commits (1)

  • 72515b9 Content mods: shared tags merge like a data pack's, replace honoured with a warning

📊 Changes

5 files changed (+214 additions, -45 deletions)

View changed files

📝 crates/horizon-client/src/mod_content.rs (+89 -29)
📝 crates/horizon-client/src/mod_content_tests.rs (+89 -0)
📝 crates/horizon-port-pack/src/carry.rs (+21 -14)
📝 docs/modpacks.md (+4 -2)
📝 docs/mods.md (+11 -0)

📄 Description

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

Stacked on #974 (Towns and Towers' namespaces, itself on #969): retarget to main once those merge.

What

Orchestrator decision 1 (2026-10-19): mods may add to vanilla tags exactly as a vanilla data pack does.

  • Game (horizon_client::mod_content): every mod's file for one tag (data/minecraft/tags/**, the convention data/c/tags/**, or another mod's) merges in load order, as TagLoader does across packs. "replace": false appends after vanilla's entries and the earlier mods'. "replace": true is now honoured: it first drops vanilla's entries and the earlier mods' values, and the mods after it still add theirs. It used to refuse the whole content root. The merged tag file, the block tag bundles and the worldgen loader's biome tag bundle all follow this.
  • Warning: a replace that drops something is logged with the mod, the tag and what it dropped: mod t_and_t replaces data/minecraft/tags/worldgen/biome/has_structure/village_plains.json: vanilla's entries and those of regions_unexplored are left out, as a data pack's replace does; the mods after it in load order still add to it. The root keeps its warnings (horizon-mod-content-warnings.txt), so a start that reuses the cached root logs them too. A mod replacing a tag of its own namespace that nobody else added to drops nothing and does not warn.
  • Carry keeps a vanilla or convention tag with replace: true as it is (it went to outside/ as unreadable). Towns and Towers' seven minecraft:has_structure/* biome tags now load.
  • Mods still own no other minecraft content: the fence is unchanged (tags only).
  • docs/mods.md describes the merge order and the warning; docs/modpacks.md the carry.

Why

modpacks-11 brief, step 2. Towns and Towers narrows vanilla's villages and outposts to the biomes it wants (pillager_outpost → plains only, village_plains loses the meadow) and adds its own; without its tags both sets overlapped.

How tested

cargo fmt --all -- --check                                   ok
cargo clippy --workspace --all-targets -- -D warnings        ok (integration commit: main + #969 #974 #975 #983 #984 #988 + this + #1019)
cargo test -p horizon-client --lib mod_content               17 passed (new: tags_merge_in_load_order_and_replace_warns, a_replacing_mod_tag_reaches_the_root)
cargo test -p horizon-port-pack                              49 passed (carry keeps the replacing vanilla tag as it is)
  • tags_merge_in_load_order_and_replace_warns: a adds, b replaces (warning names vanilla and a), c adds after it (kept), d replaces again (warning names b, c only); a mod's own tag replacing drops nothing and stays quiet.
  • a_replacing_mod_tag_reaches_the_root: three folder mods over the prepared base; vanilla's village_plains (plains, meadow) becomes [plains, savanna] in both the tag file and worldgen/biome_tags.json, and the warning is in the root.

On ATM10's 42 re-carried mods the root builds with the 7 warnings above (Regions Unexplored adds its biomes to the same 7 tags first, in mod id order). Structure starts in chunks -64..63, seeds 1234 and 2, all three dimensions: unchanged (no vanilla village or outpost outside plains in those squares).

Parity: the harnesses --changed selects for this stack run once on the integration commit; results follow in a comment.

Needs Ludovic

Nothing (decision made by the orchestrator; load order between mods is the game's mod order, which a warning now makes visible).

🤖 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/1021 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/19/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/mod-vanilla-tags` --- ### 📝 Commits (1) - [`72515b9`](https://github.com/horizon-rust/horizon/commit/72515b99a79bca2bc718dd525732ef3167d066f0) Content mods: shared tags merge like a data pack's, replace honoured with a warning ### 📊 Changes **5 files changed** (+214 additions, -45 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mod_content.rs` (+89 -29) 📝 `crates/horizon-client/src/mod_content_tests.rs` (+89 -0) 📝 `crates/horizon-port-pack/src/carry.rs` (+21 -14) 📝 `docs/modpacks.md` (+4 -2) 📝 `docs/mods.md` (+11 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Stacked on #974 (Towns and Towers' namespaces, itself on #969): retarget to main once those merge. ## What Orchestrator decision 1 (2026-10-19): mods may add to vanilla tags exactly as a vanilla data pack does. - **Game** (`horizon_client::mod_content`): every mod's file for one tag (`data/minecraft/tags/**`, the convention `data/c/tags/**`, or another mod's) merges in load order, as TagLoader does across packs. `"replace": false` appends after vanilla's entries and the earlier mods'. `"replace": true` is now honoured: it first drops vanilla's entries and the earlier mods' values, and the mods after it still add theirs. It used to refuse the whole content root. The merged tag file, the block tag bundles and the worldgen loader's biome tag bundle all follow this. - **Warning**: a replace that drops something is logged with the mod, the tag and what it dropped: `mod t_and_t replaces data/minecraft/tags/worldgen/biome/has_structure/village_plains.json: vanilla's entries and those of regions_unexplored are left out, as a data pack's replace does; the mods after it in load order still add to it`. The root keeps its warnings (`horizon-mod-content-warnings.txt`), so a start that reuses the cached root logs them too. A mod replacing a tag of its own namespace that nobody else added to drops nothing and does not warn. - **Carry** keeps a vanilla or convention tag with `replace: true` as it is (it went to `outside/` as unreadable). Towns and Towers' seven `minecraft:has_structure/*` biome tags now load. - Mods still own no other `minecraft` content: the fence is unchanged (tags only). - docs/mods.md describes the merge order and the warning; docs/modpacks.md the carry. ## Why modpacks-11 brief, step 2. Towns and Towers narrows vanilla's villages and outposts to the biomes it wants (`pillager_outpost` → plains only, `village_plains` loses the meadow) and adds its own; without its tags both sets overlapped. ## How tested ``` cargo fmt --all -- --check ok cargo clippy --workspace --all-targets -- -D warnings ok (integration commit: main + #969 #974 #975 #983 #984 #988 + this + #1019) cargo test -p horizon-client --lib mod_content 17 passed (new: tags_merge_in_load_order_and_replace_warns, a_replacing_mod_tag_reaches_the_root) cargo test -p horizon-port-pack 49 passed (carry keeps the replacing vanilla tag as it is) ``` - `tags_merge_in_load_order_and_replace_warns`: a adds, b replaces (warning names vanilla and a), c adds after it (kept), d replaces again (warning names b, c only); a mod's own tag replacing drops nothing and stays quiet. - `a_replacing_mod_tag_reaches_the_root`: three folder mods over the prepared base; vanilla's `village_plains` (plains, meadow) becomes `[plains, savanna]` in both the tag file and `worldgen/biome_tags.json`, and the warning is in the root. On ATM10's 42 re-carried mods the root builds with the 7 warnings above (Regions Unexplored adds its biomes to the same 7 tags first, in mod id order). Structure starts in chunks -64..63, seeds 1234 and 2, all three dimensions: unchanged (no vanilla village or outpost outside plains in those squares). Parity: the harnesses `--changed` selects for this stack run once on the integration commit; results follow in a comment. ## Needs Ludovic Nothing (decision made by the orchestrator; load order between mods is the game's mod order, which a warning now makes visible). 🤖 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 16:00:41 +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#2994
No description provided.