[PR #2616] [MERGED] launcher: find data packs on Modrinth and install one into a world #4475

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

📋 Pull Request Information

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

Base: main ← Head: feat/launcher-datapack-browser


📝 Commits (1)

  • 2a74206 launcher: find data packs on Modrinth and install one into a world

📊 Changes

16 files changed (+548 additions, -21 deletions)

View changed files

📝 docs/launcher-commands.md (+3 -2)
📝 docs/mod-browser.md (+2 -1)
📝 launcher/README.md (+3 -1)
📝 launcher/src/browser.rs (+52 -6)
📝 launcher/src/browser/curseforge.rs (+1 -0)
📝 launcher/src/browser/horizon.rs (+1 -0)
📝 launcher/src/browser/installed.rs (+62 -0)
📝 launcher/src/browser/installed/tests.rs (+88 -0)
📝 launcher/src/browser/modrinth.rs (+21 -4)
📝 launcher/src/browser/tests.rs (+45 -0)
📝 launcher/src/cli.rs (+47 -1)
📝 launcher/src/datapacks.rs (+76 -0)
📝 launcher/src/datapacks/tests.rs (+35 -0)
📝 launcher/src/datapacks_page.rs (+9 -0)
📝 launcher/src/main.rs (+1 -1)
📝 launcher/src/mods_page.rs (+102 -5)

📄 Description

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

Clean room: designed from the feature list in briefs/launcher-features-1.md; no other launcher's code, docs or assets were read.

Launcher features, item 9, part 2: data packs from Modrinth's data pack type, installed into a world. Part 1 (a world's data packs, from a zip) is #2612. Stacked on #2614 (installs go into the selected instance).

What it does

  • Mods page → Data packs tab (Modrinth only): search with Modrinth's project_type:datapack facet, 26.3 unless Show everything. Each result is Partly, with what Horizon runs of a data pack today. I checked the game's DataStore (crates/horizon-client/src/datapack.rs, game/functions.rs): it reads functions, function tags, predicates and item modifiers, not yet recipes, loot tables, advancements, other tags or worldgen.
  • World picker: the tab lists the selected instance's worlds, the last played first. Install puts the pack into the picked world. With no world yet, the tab says to make one in the game first.
  • Install: the newest version whose loader is datapack. Most data packs on Modrinth also ship a Fabric/NeoForge build, and that build is never picked. The file is checked against its SHA-512, then copied into <world>/datapacks/ under a free name with part 1's datapacks::add. The game turns it on when the world opens.
  • What runs: the launcher reads the zip and reports, e.g. "Runs its 33 functions, 2 function tags, 4 predicates. Not read yet: …" (the six biggest kinds). A pack with none of the kinds Horizon reads is refused rather than installed to do nothing. Example: Tectonic, worldgen only.
  • Data packs are not added to the browser's Installed list (mod-browser.json is per game folder). The world's own list on Home shows them, and the panel refreshes after an install.
  • CLI / MCP: mods search --kind datapack and mods install <pack> --world <world> [--instance …]. The MCP tools come from the CLI.
  • Library: Kind::DataPack (Modrinth datapack, CurseForge class 6945 for when CurseForge opens), Project::as_datapack, pick and support for data packs, installed::install_datapack, datapacks::coverage.

Proof

  • cargo fmt --check, cargo clippy --all-targets --locked --features gpui/runtime_shaders -- -D warnings: clean. cargo test --locked --features gpui/runtime_shaders --lib --bins: 159 + 36 passed. New tests:
    • data_packs_are_their_own_kind: pick skips mod builds; support; facets; a hit marked as a data pack.
    • data_packs_go_into_a_world_when_something_in_them_runs: install, free name, refused worldgen-only pack, tampered download refused, nothing in mod-browser.json.
    • coverage_says_what_runs.
  • Live CLI, scratch homes:
    • VeinMiner 1.3.6 installed and runs 33 functions, 2 function tags, 4 predicates.
    • Terralith 2.6.5+26.3 installed: 3 functions run; its 1,648 worldgen files are not read yet, and the message says so.
    • Dungeons and Taverns 6.0.2 installed.
    • Tectonic and Trek were refused (worldgen only).
  • Window, scratch homes:
    • Picked Castle build and installed VeinMiner.
    • Picked Hardcore 1 and installed Dungeons and Taverns.
    • Tectonic was refused.
    • The world's Data packs panel on Home lists what was installed.
Data packs tab Refused Installed The world's list on Home

🤖 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/2616 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/launcher-datapack-browser` --- ### 📝 Commits (1) - [`2a74206`](https://github.com/horizon-rust/horizon/commit/2a7420651e8b03e255cf63bba91a462b4b4ea335) launcher: find data packs on Modrinth and install one into a world ### 📊 Changes **16 files changed** (+548 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `docs/launcher-commands.md` (+3 -2) 📝 `docs/mod-browser.md` (+2 -1) 📝 `launcher/README.md` (+3 -1) 📝 `launcher/src/browser.rs` (+52 -6) 📝 `launcher/src/browser/curseforge.rs` (+1 -0) 📝 `launcher/src/browser/horizon.rs` (+1 -0) 📝 `launcher/src/browser/installed.rs` (+62 -0) 📝 `launcher/src/browser/installed/tests.rs` (+88 -0) 📝 `launcher/src/browser/modrinth.rs` (+21 -4) 📝 `launcher/src/browser/tests.rs` (+45 -0) 📝 `launcher/src/cli.rs` (+47 -1) 📝 `launcher/src/datapacks.rs` (+76 -0) 📝 `launcher/src/datapacks/tests.rs` (+35 -0) 📝 `launcher/src/datapacks_page.rs` (+9 -0) 📝 `launcher/src/main.rs` (+1 -1) 📝 `launcher/src/mods_page.rs` (+102 -5) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Clean room: designed from the feature list in briefs/launcher-features-1.md; no other launcher's code, docs or assets were read. Launcher features, item 9, part 2: data packs from Modrinth's data pack type, installed into a world. Part 1 (a world's data packs, from a zip) is #2612. Stacked on #2614 (installs go into the selected instance). ## What it does - **Mods page → Data packs tab** (Modrinth only): search with Modrinth's `project_type:datapack` facet, 26.3 unless **Show everything**. Each result is **Partly**, with what Horizon runs of a data pack today. I checked the game's `DataStore` (`crates/horizon-client/src/datapack.rs`, `game/functions.rs`): it reads functions, function tags, predicates and item modifiers, not yet recipes, loot tables, advancements, other tags or worldgen. - **World picker:** the tab lists the selected instance's worlds, the last played first. **Install** puts the pack into the picked world. With no world yet, the tab says to make one in the game first. - **Install:** the newest version whose loader is `datapack`. Most data packs on Modrinth also ship a Fabric/NeoForge build, and that build is never picked. The file is checked against its SHA-512, then copied into `<world>/datapacks/` under a free name with part 1's `datapacks::add`. The game turns it on when the world opens. - **What runs:** the launcher reads the zip and reports, e.g. "Runs its 33 functions, 2 function tags, 4 predicates. Not read yet: …" (the six biggest kinds). A pack with none of the kinds Horizon reads is refused rather than installed to do nothing. Example: Tectonic, worldgen only. - Data packs are not added to the browser's Installed list (`mod-browser.json` is per game folder). The world's own list on Home shows them, and the panel refreshes after an install. - **CLI / MCP:** `mods search --kind datapack` and `mods install <pack> --world <world> [--instance …]`. The MCP tools come from the CLI. - **Library:** `Kind::DataPack` (Modrinth `datapack`, CurseForge class 6945 for when CurseForge opens), `Project::as_datapack`, `pick` and `support` for data packs, `installed::install_datapack`, `datapacks::coverage`. ## Proof - `cargo fmt --check`, `cargo clippy --all-targets --locked --features gpui/runtime_shaders -- -D warnings`: clean. `cargo test --locked --features gpui/runtime_shaders --lib --bins`: 159 + 36 passed. New tests: - `data_packs_are_their_own_kind`: pick skips mod builds; support; facets; a hit marked as a data pack. - `data_packs_go_into_a_world_when_something_in_them_runs`: install, free name, refused worldgen-only pack, tampered download refused, nothing in mod-browser.json. - `coverage_says_what_runs`. - **Live CLI, scratch homes:** - VeinMiner 1.3.6 installed and runs 33 functions, 2 function tags, 4 predicates. - Terralith 2.6.5+26.3 installed: 3 functions run; its 1,648 worldgen files are not read yet, and the message says so. - Dungeons and Taverns 6.0.2 installed. - Tectonic and Trek were refused (worldgen only). - **Window, scratch homes:** - Picked Castle build and installed VeinMiner. - Picked Hardcore 1 and installed Dungeons and Taverns. - Tectonic was refused. - The world's Data packs panel on Home lists what was installed. | Data packs tab | Refused | Installed | The world's list on Home | |---|---|---|---| | ![](https://raw.githubusercontent.com/ludovic111/horizon/screenshots/launcher-features/datapack-browser/tab.png) | ![](https://raw.githubusercontent.com/ludovic111/horizon/screenshots/launcher-features/datapack-browser/refused.png) | ![](https://raw.githubusercontent.com/ludovic111/horizon/screenshots/launcher-features/datapack-browser/installed.png) | ![](https://raw.githubusercontent.com/ludovic111/horizon/screenshots/launcher-features/datapack-browser/world-list.png) | 🤖 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:17:26 +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#4475
No description provided.