[PR #969] [MERGED] Content mods: namespaces besides the mod id, and no namespace shared by two mods #2951

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

📋 Pull Request Information

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

Base: main ← Head: feat/mod-extra-namespaces


📝 Commits (1)

  • df8bc60 Content mods: namespaces besides the mod id, with no namespace shared by two mods

📊 Changes

8 files changed (+278 additions, -18 deletions)

View changed files

📝 crates/horizon-client/examples/mod_port_probe.rs (+4 -2)
📝 crates/horizon-client/src/game/mods.rs (+12 -1)
📝 crates/horizon-client/src/mod_content.rs (+20 -5)
📝 crates/horizon-client/src/mod_content_tests.rs (+97 -0)
📝 crates/horizon-mods/src/content.rs (+60 -6)
📝 crates/horizon-mods/src/manifest.rs (+57 -0)
📝 docs/modpacks.md (+4 -0)
📝 docs/mods.md (+24 -4)

📄 Description

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

Carry claims these namespaces for Towns and Towers in the stacked PR (feat/carry-extra-namespaces). This PR builds alone; no existing mod changes.

What

Some Java mods ship their files under other names than their mod id. Towns and Towers (mod id t_and_t) has all 60 of its structures under kaisyn and towns_and_towers, so its carried mod held nothing the game would load. The orchestrator's decision: a mod's content may use the extra namespaces it ships, as long as they don't collide with minecraft or another loaded mod's id or namespaces, and a collision is a clear error naming both mods.

  • Manifest: namespaces = ["kaisyn", "towns_and_towers"] in horizon-mod.toml (content mods only, i.e. capability registries). Names use vanilla's namespace characters. minecraft, c and horizon cannot be listed, and repeats are refused.
  • Fence (horizon_mods::content): a listed namespace is the mod's, just like its id: assets/<ns>/ and data/<ns>/ load. Blocks and items are still declared only under data/<id>/horizon/.
  • Collision rule (content::clash): two content mods that are on and own the same namespace (one's id or listed namespace being the other's) give mods A and B both use the namespace N; turn one of them off. mod_content::build refuses such a set. The game keeps the first mod in load order and leaves the other's content out, with that line in the log, so the other mods still load.
  • Loaders: the root's marker (horizon-mod-content.json) now lists every owned namespace instead of only mod ids, so recipes, tags, names, creative tabs and station recipes read the listed namespaces too. With no listed namespaces the marker is the same as before.
  • Docs: docs/mods.md (manifest key, fence, collision) and docs/modpacks.md (registries 0.2).

Tests

  • manifest::checks_extra_namespaces: owned namespaces, reserved names, repeats, bad characters, and a code-only mod refused.
  • content::listed_namespaces_hold_content: files in a listed namespace load; declarations there and unlisted namespaces are refused.
  • content::mods_sharing_a_namespace_clash, mod_content::mods_sharing_a_namespace_are_refused: the error names both mods (id against listed namespace, and listed against listed).
  • mod_content::listed_namespaces_join_the_root: a listed namespace's processor list and biome tag reach the worldgen bundles, and the marker lists it.

Self-check

cargo fmt --all --check                                                   ok
cargo clippy -p horizon-mods -p horizon-client --all-targets -- -D warnings  ok
cargo test -p horizon-mods                                                11 + 7 passed
cargo test -p horizon-client --lib mod_content                            14 passed

Game-side parity harnesses: to be run on one integration commit of this wave's game-side PRs (results will be added here).

Nothing needs Ludovic.

Integration run (game-side PRs together)

One commit merging this PR with #969, #974, #975, #981, #982, #983, #984, #988, #989 on main 0af3dd39:

cargo fmt --all -- --check                                                      ok
cargo clippy --workspace --all-targets -- -D warnings                           ok
cargo test -p horizon-world -p horizon-port-pack -p horizon-mods -p horizon-client   ok (0 failed)
tools/parity.py --changed origin/main                                           301 passed, 0 failed in 207.2 min (mob_ai and command_exec included)
vanilla structure-start oracle, chunks -64..63                                  150/150 (seed 1234), 134/134 (seed 2)

(#969's first CI parity run failed command_exec on /random reset * (11 vs 12 sequences); its rerun passed 780/780, so that was a flake. The rerun's mob_ai failure was its Java oracle crashing under load; mob_ai passes on the integration commit.)

🤖 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/969 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/19/2026 **Status:** ✅ Merged **Merged:** 10/19/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/mod-extra-namespaces` --- ### 📝 Commits (1) - [`df8bc60`](https://github.com/horizon-rust/horizon/commit/df8bc603ff5868ac7fce8082c58bc83328309453) Content mods: namespaces besides the mod id, with no namespace shared by two mods ### 📊 Changes **8 files changed** (+278 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/examples/mod_port_probe.rs` (+4 -2) 📝 `crates/horizon-client/src/game/mods.rs` (+12 -1) 📝 `crates/horizon-client/src/mod_content.rs` (+20 -5) 📝 `crates/horizon-client/src/mod_content_tests.rs` (+97 -0) 📝 `crates/horizon-mods/src/content.rs` (+60 -6) 📝 `crates/horizon-mods/src/manifest.rs` (+57 -0) 📝 `docs/modpacks.md` (+4 -0) 📝 `docs/mods.md` (+24 -4) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Carry claims these namespaces for Towns and Towers in the stacked PR (feat/carry-extra-namespaces). This PR builds alone; no existing mod changes. ## What Some Java mods ship their files under other names than their mod id. Towns and Towers (mod id `t_and_t`) has all 60 of its structures under `kaisyn` and `towns_and_towers`, so its carried mod held nothing the game would load. The orchestrator's decision: a mod's content may use the extra namespaces it ships, as long as they don't collide with `minecraft` or another loaded mod's id or namespaces, and a collision is a clear error naming both mods. - **Manifest:** `namespaces = ["kaisyn", "towns_and_towers"]` in `horizon-mod.toml` (content mods only, i.e. capability `registries`). Names use vanilla's namespace characters. `minecraft`, `c` and `horizon` cannot be listed, and repeats are refused. - **Fence** (`horizon_mods::content`): a listed namespace is the mod's, just like its id: `assets/<ns>/` and `data/<ns>/` load. Blocks and items are still declared only under `data/<id>/horizon/`. - **Collision rule** (`content::clash`): two content mods that are on and own the same namespace (one's id or listed namespace being the other's) give `mods A and B both use the namespace N; turn one of them off`. `mod_content::build` refuses such a set. The game keeps the first mod in load order and leaves the other's content out, with that line in the log, so the other mods still load. - **Loaders:** the root's marker (`horizon-mod-content.json`) now lists every owned namespace instead of only mod ids, so recipes, tags, names, creative tabs and station recipes read the listed namespaces too. With no listed namespaces the marker is the same as before. - Docs: docs/mods.md (manifest key, fence, collision) and docs/modpacks.md (registries 0.2). ## Tests - `manifest::checks_extra_namespaces`: owned namespaces, reserved names, repeats, bad characters, and a code-only mod refused. - `content::listed_namespaces_hold_content`: files in a listed namespace load; declarations there and unlisted namespaces are refused. - `content::mods_sharing_a_namespace_clash`, `mod_content::mods_sharing_a_namespace_are_refused`: the error names both mods (id against listed namespace, and listed against listed). - `mod_content::listed_namespaces_join_the_root`: a listed namespace's processor list and biome tag reach the worldgen bundles, and the marker lists it. ## Self-check ``` cargo fmt --all --check ok cargo clippy -p horizon-mods -p horizon-client --all-targets -- -D warnings ok cargo test -p horizon-mods 11 + 7 passed cargo test -p horizon-client --lib mod_content 14 passed ``` Game-side parity harnesses: to be run on one integration commit of this wave's game-side PRs (results will be added here). Nothing needs Ludovic. ## Integration run (game-side PRs together) One commit merging this PR with #969, #974, #975, #981, #982, #983, #984, #988, #989 on main 0af3dd39: ``` cargo fmt --all -- --check ok cargo clippy --workspace --all-targets -- -D warnings ok cargo test -p horizon-world -p horizon-port-pack -p horizon-mods -p horizon-client ok (0 failed) tools/parity.py --changed origin/main 301 passed, 0 failed in 207.2 min (mob_ai and command_exec included) vanilla structure-start oracle, chunks -64..63 150/150 (seed 1234), 134/134 (seed 2) ``` (#969's first CI parity run failed command_exec on `/random reset *` (11 vs 12 sequences); its rerun passed 780/780, so that was a flake. The rerun's mob_ai failure was its Java oracle crashing under load; mob_ai passes on the integration commit.) 🤖 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:22 +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#2951
No description provided.