[PR #3667] [MERGED] Mods: structures, pools and templates from content mods show in command suggestions #5136

Closed
opened 2026-11-03 05:10:30 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3667
Author: @xFedeT
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @levzzz5154

Base: main ← Head: fix/mod-structure-suggestions


📝 Commits (3)

  • 9c5377a Mods: structures, sets, pools and templates from content mods reach command suggestions
  • d9e70d5 Commands: suggest the templates of every namespace, not only minecraft's
  • 0a770a0 Merge main into fix/mod-structure-suggestions

📊 Changes

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

View changed files

📝 crates/horizon-client/src/game/chat.rs (+22 -2)
📝 crates/horizon-client/src/mod_content.rs (+52 -0)
📝 crates/horizon-client/src/mod_content_tests.rs (+18 -0)

📄 Description

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

Fixes #3628.

What and why

A content mod's structures generate and /locate structure <ns>:<id> finds them, but Tab only offered vanilla ids. Two gaps:

  1. The content merge (mod_content.rs) added a mod's items and blocks to command-registries.json, but its worldgen ids only went into the worldgen bundles. /locate structure, /place structure and /place jigsaw read their suggestions from that file.
  2. /place template suggestions were built in game/chat.rs from worldgen/structure/minecraft only, so a mod's templates (worldgen/structure/<ns>/...) were never listed.

Change

  • mod_content.rs: after the worldgen bundles are written, append the mod's ids (no repeats, vanilla first) to by_registry/minecraft:worldgen/{structure,structure_set,template_pool,processor_list,feature,placed_feature}/ids. horizon:add_to files add to other entries, so they are not listed.
  • game/chat.rs: scan every namespace under worldgen/structure for templates (ns:path).

Horizon-only (mod content); vanilla has no equivalent, so no vanilla reference applies.

Not in this PR

/place structure <id> answers "An unexpected error occurred" for any structure, vanilla ones too (game/commands/place.rs: "Structure.generate is not wired to the live level"). Already the case on main.

Testing

  • content_root_carries_a_structure_mod (ignored content-root test) now checks the structure, set and pool ids in the built root; it failed before the change.
  • Manual QA by Federico, in game with a small content mod (huts: structure, set, pool, template): Tab after /locate structure huts, /place jigsaw huts and /place template huts offers huts:hut(/start); vanilla suggestions still there; /locate structure huts:hut finds it; /place template huts:hut ~ ~ ~ places it.

pr_ready --quick: see the checks run on the final commit: Python tests, rustfmt, clippy, horizon-client tests, doc tests and content root tests all pass. Parity harnesses not run locally (the shared files select 345); CI picks them.

🤖 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/3667 **Author:** [@xFedeT](https://github.com/xFedeT) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix/mod-structure-suggestions` --- ### 📝 Commits (3) - [`9c5377a`](https://github.com/horizon-rust/horizon/commit/9c5377a57159a5e92a4a30f3d6b10a7ebcb5e660) Mods: structures, sets, pools and templates from content mods reach command suggestions - [`d9e70d5`](https://github.com/horizon-rust/horizon/commit/d9e70d5ca7208f3999242a6a2d54d323570ef3ed) Commands: suggest the templates of every namespace, not only minecraft's - [`0a770a0`](https://github.com/horizon-rust/horizon/commit/0a770a0e149db6efe29a24bb091ff1c21e2fce5f) Merge main into fix/mod-structure-suggestions ### 📊 Changes **3 files changed** (+92 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/chat.rs` (+22 -2) 📝 `crates/horizon-client/src/mod_content.rs` (+52 -0) 📝 `crates/horizon-client/src/mod_content_tests.rs` (+18 -0) </details> ### 📄 Description > 🤖 Opened by Federico's AI agent (Claude), not by Federico himself. Fixes #3628. ## What and why A content mod's structures generate and `/locate structure <ns>:<id>` finds them, but Tab only offered vanilla ids. Two gaps: 1. The content merge (`mod_content.rs`) added a mod's items and blocks to `command-registries.json`, but its worldgen ids only went into the worldgen bundles. `/locate structure`, `/place structure` and `/place jigsaw` read their suggestions from that file. 2. `/place template` suggestions were built in `game/chat.rs` from `worldgen/structure/minecraft` only, so a mod's templates (`worldgen/structure/<ns>/...`) were never listed. ## Change - `mod_content.rs`: after the worldgen bundles are written, append the mod's ids (no repeats, vanilla first) to `by_registry/minecraft:worldgen/{structure,structure_set,template_pool,processor_list,feature,placed_feature}/ids`. `horizon:add_to` files add to other entries, so they are not listed. - `game/chat.rs`: scan every namespace under `worldgen/structure` for templates (`ns:path`). Horizon-only (mod content); vanilla has no equivalent, so no vanilla reference applies. ## Not in this PR `/place structure <id>` answers "An unexpected error occurred" for any structure, vanilla ones too (`game/commands/place.rs`: "Structure.generate is not wired to the live level"). Already the case on main. ## Testing - `content_root_carries_a_structure_mod` (ignored content-root test) now checks the structure, set and pool ids in the built root; it failed before the change. - Manual QA by Federico, in game with a small content mod (`huts`: structure, set, pool, template): Tab after `/locate structure huts`, `/place jigsaw huts` and `/place template huts` offers `huts:hut`(`/start`); vanilla suggestions still there; `/locate structure huts:hut` finds it; `/place template huts:hut ~ ~ ~` places it. **pr_ready --quick**: see the checks run on the final commit: Python tests, rustfmt, clippy, horizon-client tests, doc tests and content root tests all pass. Parity harnesses not run locally (the shared files select 345); CI picks them. 🤖 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 05:10:30 +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#5136
No description provided.