[PR #663] [MERGED] Launcher: Import modpack, its coverage report, port and play it as a profile #2710

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

📋 Pull Request Information

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

Base: main ← Head: feat/launcher-import-modpack


📝 Commits (2)

  • ee10460 horizon-port-pack: a library, fetch and port; CurseForge zips name their mods
  • 206b91e Launcher: Import modpack, its coverage report, port and play it as a profile

📊 Changes

18 files changed (+1667 additions, -228 deletions)

View changed files

➕ crates/horizon-port-pack/src/fetch.rs (+389 -0)
📝 crates/horizon-port-pack/src/import.rs (+57 -2)
➕ crates/horizon-port-pack/src/lib.rs (+17 -0)
📝 crates/horizon-port-pack/src/main.rs (+70 -187)
📝 crates/horizon-port-pack/src/modrinth.rs (+3 -3)
➕ crates/horizon-port-pack/src/pipeline.rs (+237 -0)
📝 crates/horizon-port-pack/src/report.rs (+1 -1)
📝 docs/modpacks.md (+18 -2)
📝 launcher/Cargo.lock (+13 -0)
📝 launcher/Cargo.toml (+2 -0)
📝 launcher/README.md (+17 -1)
➕ launcher/docs/modpacks.png (+0 -0)
📝 launcher/src/backend.rs (+4 -0)
📝 launcher/src/cli.rs (+104 -0)
📝 launcher/src/lib.rs (+1 -0)
📝 launcher/src/main.rs (+73 -32)
➕ launcher/src/modpacks.rs (+249 -0)
➕ launcher/src/modpacks_page.rs (+412 -0)

📄 Description

Stacked on #653 (horizon-port-pack as a library, fetch and port): merge that first; this PR then shows only its own commit.

What

A Modpacks page in the launcher, between Versions and Patch notes, for the working version's launcher step (docs/modpacks.md):

  1. Import a pack file (.mrpack, CurseForge .zip) or an instance folder (Prism, MultiMC, CurseForge). It runs horizon-port-pack's import, inventory (Modrinth answers by file hash) and report into ports/<slug>/ in the game's home.
  2. The coverage report: ported / partial / not yet / not needed, then every mod with its class, tier, licence and the reason, filtered by status.
  3. Port: gets the jars of what this computer can port today (content mods with data and assets only) the player's own way: their folder (Use jars from my instance…), the pack's own links, or the same file on Modrinth's CDN, hash-checked. What only CurseForge has needs its API key and the page says so. The jars are carried over for the selected version's prepared tables, with the pipeline's log shown while it runs.
  4. Play: starts the game as the pack's own profile. ports/<slug>/home/ holds its own saves and options (the player's options.txt is copied in the first time), and the carried-over mods load as dev mods. It shares the session flow with Play (start_client, split out of play).
  5. The same from the command line: horizon-launcher modpack list | import <pack> | port <pack> [--from <dir>] | play <pack> | remove <pack> (--json for list/import/port).

Nothing is uploaded or shared: the jars, ports and the profile stay in the game's home.

Screenshots

These come from the Linux build under Xvfb on the ThinkPad: the Mac mini's session is locked and the desktop didn't answer Wake-on-LAN. The data is real: All the Mods 10 8.3's CurseForge zip, and a six-mod .mrpack built from Modrinth's index.

All the Mods 10 imported from its CurseForge zip, after Port (42 jars came from Modrinth's CDN; 12 are CurseForge-only):
ATM10

The report's reasons, "Not yet" filter:
Not yet

Porting a six-mod .mrpack (jars downloaded from the pack's own Modrinth links):
Porting
Ported

The ported pack played as its profile (horizon-launcher modpack play builders-six, then the same arguments through horizon-ctl --offscreen for the picture): Factory Blocks, Cloud Glass, Glassential, Macaw's Fences, Trapdoors and Paths blocks placed in a 26.3 world, 61,998 block states:
In game

Known limits (next PRs)

  • All the Mods 10's 42 carried mods exceed the 65,536 block states chunks hold (#648's guard), so the game starts its profile without content mods. Block state ids wider than 16 bits are my next PR. The six-mod pack fits and plays.
  • "Ported" needs the per-mod harness (a dev step with the NeoForge oracle), so on a player's machine carried mods show as partial, "harness not run".
  • The file pickers use the platform's dialog (the XDG portal on Linux), so they weren't clicked in the headless run. Import there went through the same modpacks::import from the command line.

Tests

  • launcher: cargo fmt -- --check, cargo clippy --all-targets --features gpui/runtime_shaders -- -D warnings: clean. cargo test --features gpui/runtime_shaders: 53 + 4 + 1 passed. New: pack slugs; a profile gets its own home and only the carried mods that have a manifest.
  • Workspace: cargo clippy --workspace --all-targets -- -D warnings clean (#653).
  • End to end on macOS (Mac mini): modpack import / port / play on both packs. The game loaded "content from 6 mod(s)" in the profile's home.
  • Parity: tools/parity.py --changed origin/main selects 0 of 309 harnesses (launcher and port-pack only).

Needs Ludovic

  • The CurseForge API key question (docs/modpacks.md, open questions). Without it, CurseForge-only files come from the player's instance.

🤖 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/663 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/17/2026 **Status:** ✅ Merged **Merged:** 10/17/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/launcher-import-modpack` --- ### 📝 Commits (2) - [`ee10460`](https://github.com/horizon-rust/horizon/commit/ee104603dde8ebbe5c86efa939de4259f958fd16) horizon-port-pack: a library, fetch and port; CurseForge zips name their mods - [`206b91e`](https://github.com/horizon-rust/horizon/commit/206b91e8aa6576c2a5e5d7e0ed3695d33920c7e3) Launcher: Import modpack, its coverage report, port and play it as a profile ### 📊 Changes **18 files changed** (+1667 additions, -228 deletions) <details> <summary>View changed files</summary> ➕ `crates/horizon-port-pack/src/fetch.rs` (+389 -0) 📝 `crates/horizon-port-pack/src/import.rs` (+57 -2) ➕ `crates/horizon-port-pack/src/lib.rs` (+17 -0) 📝 `crates/horizon-port-pack/src/main.rs` (+70 -187) 📝 `crates/horizon-port-pack/src/modrinth.rs` (+3 -3) ➕ `crates/horizon-port-pack/src/pipeline.rs` (+237 -0) 📝 `crates/horizon-port-pack/src/report.rs` (+1 -1) 📝 `docs/modpacks.md` (+18 -2) 📝 `launcher/Cargo.lock` (+13 -0) 📝 `launcher/Cargo.toml` (+2 -0) 📝 `launcher/README.md` (+17 -1) ➕ `launcher/docs/modpacks.png` (+0 -0) 📝 `launcher/src/backend.rs` (+4 -0) 📝 `launcher/src/cli.rs` (+104 -0) 📝 `launcher/src/lib.rs` (+1 -0) 📝 `launcher/src/main.rs` (+73 -32) ➕ `launcher/src/modpacks.rs` (+249 -0) ➕ `launcher/src/modpacks_page.rs` (+412 -0) </details> ### 📄 Description Stacked on #653 (horizon-port-pack as a library, fetch and port): merge that first; this PR then shows only its own commit. ## What A **Modpacks** page in the launcher, between Versions and Patch notes, for the working version's launcher step (docs/modpacks.md): 1. **Import** a pack file (`.mrpack`, CurseForge `.zip`) or an instance folder (Prism, MultiMC, CurseForge). It runs horizon-port-pack's import, inventory (Modrinth answers by file hash) and report into `ports/<slug>/` in the game's home. 2. **The coverage report**: ported / partial / not yet / not needed, then every mod with its class, tier, licence and the reason, filtered by status. 3. **Port**: gets the jars of what this computer can port today (content mods with data and assets only) the player's own way: their folder (**Use jars from my instance…**), the pack's own links, or the same file on Modrinth's CDN, hash-checked. What only CurseForge has needs its API key and the page says so. The jars are carried over for the selected version's prepared tables, with the pipeline's log shown while it runs. 4. **Play**: starts the game as the pack's own profile. `ports/<slug>/home/` holds its own saves and options (the player's `options.txt` is copied in the first time), and the carried-over mods load as dev mods. It shares the session flow with Play (`start_client`, split out of `play`). 5. The same from the command line: `horizon-launcher modpack list | import <pack> | port <pack> [--from <dir>] | play <pack> | remove <pack>` (`--json` for list/import/port). Nothing is uploaded or shared: the jars, ports and the profile stay in the game's home. ## Screenshots These come from the Linux build under Xvfb on the ThinkPad: the Mac mini's session is locked and the desktop didn't answer Wake-on-LAN. The data is real: All the Mods 10 8.3's CurseForge zip, and a six-mod `.mrpack` built from Modrinth's index. All the Mods 10 imported from its CurseForge zip, after Port (42 jars came from Modrinth's CDN; 12 are CurseForge-only): ![ATM10](https://raw.githubusercontent.com/ludovic111/horizon/5ae92503eb682cbcfcd6a5c1fc6a69c6c94094a5/modpacks-atm10.png) The report's reasons, "Not yet" filter: ![Not yet](https://raw.githubusercontent.com/ludovic111/horizon/5ae92503eb682cbcfcd6a5c1fc6a69c6c94094a5/modpacks-not-yet.png) Porting a six-mod `.mrpack` (jars downloaded from the pack's own Modrinth links): ![Porting](https://raw.githubusercontent.com/ludovic111/horizon/5ae92503eb682cbcfcd6a5c1fc6a69c6c94094a5/modpacks-porting.png) ![Ported](https://raw.githubusercontent.com/ludovic111/horizon/5ae92503eb682cbcfcd6a5c1fc6a69c6c94094a5/modpacks-ported.png) The ported pack played as its profile (`horizon-launcher modpack play builders-six`, then the same arguments through `horizon-ctl --offscreen` for the picture): Factory Blocks, Cloud Glass, Glassential, Macaw's Fences, Trapdoors and Paths blocks placed in a 26.3 world, 61,998 block states: ![In game](https://raw.githubusercontent.com/ludovic111/horizon/5ae92503eb682cbcfcd6a5c1fc6a69c6c94094a5/game-ported-blocks.png) ## Known limits (next PRs) - **All the Mods 10's 42 carried mods exceed the 65,536 block states** chunks hold (#648's guard), so the game starts its profile without content mods. Block state ids wider than 16 bits are my next PR. The six-mod pack fits and plays. - "Ported" needs the per-mod harness (a dev step with the NeoForge oracle), so on a player's machine carried mods show as partial, "harness not run". - The file pickers use the platform's dialog (the XDG portal on Linux), so they weren't clicked in the headless run. Import there went through the same `modpacks::import` from the command line. ## Tests - launcher: `cargo fmt -- --check`, `cargo clippy --all-targets --features gpui/runtime_shaders -- -D warnings`: clean. `cargo test --features gpui/runtime_shaders`: 53 + 4 + 1 passed. New: pack slugs; a profile gets its own home and only the carried mods that have a manifest. - Workspace: `cargo clippy --workspace --all-targets -- -D warnings` clean (#653). - End to end on macOS (Mac mini): `modpack import` / `port` / `play` on both packs. The game loaded "content from 6 mod(s)" in the profile's home. - Parity: `tools/parity.py --changed origin/main` selects 0 of 309 harnesses (launcher and port-pack only). ## Needs Ludovic - The CurseForge API key question (docs/modpacks.md, open questions). Without it, CurseForge-only files come from the player's instance. 🤖 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:58: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#2710
No description provided.