[PR #532] [MERGED] horizon-port-pack: import a modpack and classify its mods #2629

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

📋 Pull Request Information

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

Base: main ← Head: feat/port-pack


📝 Commits (2)

  • 746c888 horizon-mods: content mods (API 0.2), blocks and items declared from vanilla templates
  • 8585861 horizon-port-pack: import a modpack and classify its mods

📊 Changes

17 files changed (+2011 additions, -39 deletions)

View changed files

📝 Cargo.lock (+13 -0)
📝 Cargo.toml (+1 -1)
📝 crates/horizon-mods/Cargo.toml (+1 -0)
➕ crates/horizon-mods/src/content.rs (+557 -0)
📝 crates/horizon-mods/src/lib.rs (+2 -0)
📝 crates/horizon-mods/src/manifest.rs (+80 -30)
📝 crates/horizon-mods/src/runtime.rs (+15 -7)
📝 crates/horizon-mods/tests/sandbox.rs (+33 -1)
➕ crates/horizon-port-pack/Cargo.toml (+18 -0)
➕ crates/horizon-port-pack/src/classify.rs (+233 -0)
➕ crates/horizon-port-pack/src/import.rs (+335 -0)
➕ crates/horizon-port-pack/src/inventory.rs (+225 -0)
➕ crates/horizon-port-pack/src/jar.rs (+245 -0)
➕ crates/horizon-port-pack/src/main.rs (+104 -0)
➕ crates/horizon-port-pack/src/modrinth.rs (+113 -0)
📝 docs/modpacks.md (+14 -0)
📝 docs/mods.md (+22 -0)

📄 Description

Stacked on #523. First steps of the docs/modpacks.md pipeline: crates/horizon-port-pack, a CLI that imports a modpack and classifies its mods.

Commands

  • import <pack> <work> reads a Modrinth .mrpack (modrinth.index.json), a CurseForge zip (manifest.json) or a Prism / MultiMC instance (mmc-pack.json, or a plain folder of jars). It writes pack.json: the Minecraft and loader versions, each file with its hash and sides, and the overrides by folder.

  • inventory <work> [--offline] gathers metadata for each mod:

    • Modrinth's version by SHA-1 and its project (categories, licence, sides), cached in modrinth.json so reruns work offline;
    • the jars, when the user's instance has them: neoforge.mods.toml, mods.toml or fabric.mod.json, plus a census of blockstates, item models, recipes, loot, tags, worldgen, structures, classes and mixin configs. No decompiling.

    Classification uses the reviewed table first (docs/modpacks/atm10-mods.csv, included in the binary), then rules on categories, sides and the census. Each mod gets a dependency layer. It writes inventory.json and inventory.csv (the ATM10 CSV's columns plus layer).

It downloads metadata only and never fetches jars.

On a real pack

Create+ 6.0.0 alpha f is NeoForge 21.1.233 with 155 files. Only its .mrpack metadata was downloaded, into its own /tmp folder:

Create+ (mrpack): Minecraft 1.21.1, neoforge 21.1.233; files {"mods": 150, "resourcepacks": 5}; overrides {... "config": 272, "dynamic-resource-pack-cache": 396, "mods": 28 ...}
155 files, 0 jars read
class: content 54, library 33, client-ui 26, performance 25, other 14, unknown 2, server-only 1
tier: none 62, client 26, data 19, machines 17, deep 16, logic 15
confidence: categories 80, known 40, sides 21, guess 7, kind 5, unknown 2
source: modrinth 154, file 1
layers: [93, 57, 5]
4 required dependencies are not in the pack (Fabric API, which Sinytra Connector provides)

The two unknowns are ballastmod and map_atlases. Both are on Modrinth without categories that decide a class. 40 rows matched the ATM10 table by id, slug or name.

Size

About 1,000 lines with tests, over the usual ~500. The CLI, import, metadata and classification only work together. Carry-over is a separate PR stacked on this one.

Checks

  • cargo fmt --all --check passes, and cargo clippy --workspace --all-targets -- -D warnings passes.
  • cargo test -p horizon-port-pack passes (8 tests: the mrpack and CurseForge readers, mods.toml and fabric.mod.json, the census, the known table, the rules and the layers).
  • Local parity: results will follow in a comment.

🤖 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/532 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/16/2026 **Status:** ✅ Merged **Merged:** 10/16/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/port-pack` --- ### 📝 Commits (2) - [`746c888`](https://github.com/horizon-rust/horizon/commit/746c888cd3b85bfe27dbc15b292f0c62054300f6) horizon-mods: content mods (API 0.2), blocks and items declared from vanilla templates - [`8585861`](https://github.com/horizon-rust/horizon/commit/85858610bfbbd91141fec78b960334d178d0f656) horizon-port-pack: import a modpack and classify its mods ### 📊 Changes **17 files changed** (+2011 additions, -39 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+13 -0) 📝 `Cargo.toml` (+1 -1) 📝 `crates/horizon-mods/Cargo.toml` (+1 -0) ➕ `crates/horizon-mods/src/content.rs` (+557 -0) 📝 `crates/horizon-mods/src/lib.rs` (+2 -0) 📝 `crates/horizon-mods/src/manifest.rs` (+80 -30) 📝 `crates/horizon-mods/src/runtime.rs` (+15 -7) 📝 `crates/horizon-mods/tests/sandbox.rs` (+33 -1) ➕ `crates/horizon-port-pack/Cargo.toml` (+18 -0) ➕ `crates/horizon-port-pack/src/classify.rs` (+233 -0) ➕ `crates/horizon-port-pack/src/import.rs` (+335 -0) ➕ `crates/horizon-port-pack/src/inventory.rs` (+225 -0) ➕ `crates/horizon-port-pack/src/jar.rs` (+245 -0) ➕ `crates/horizon-port-pack/src/main.rs` (+104 -0) ➕ `crates/horizon-port-pack/src/modrinth.rs` (+113 -0) 📝 `docs/modpacks.md` (+14 -0) 📝 `docs/mods.md` (+22 -0) </details> ### 📄 Description Stacked on #523. First steps of the [docs/modpacks.md](../blob/main/docs/modpacks.md) pipeline: `crates/horizon-port-pack`, a CLI that imports a modpack and classifies its mods. ## Commands - **`import <pack> <work>`** reads a Modrinth `.mrpack` (`modrinth.index.json`), a CurseForge zip (`manifest.json`) or a Prism / MultiMC instance (`mmc-pack.json`, or a plain folder of jars). It writes `pack.json`: the Minecraft and loader versions, each file with its hash and sides, and the overrides by folder. - **`inventory <work> [--offline]`** gathers metadata for each mod: - Modrinth's version by SHA-1 and its project (categories, licence, sides), cached in `modrinth.json` so reruns work offline; - the jars, when the user's instance has them: `neoforge.mods.toml`, `mods.toml` or `fabric.mod.json`, plus a census of blockstates, item models, recipes, loot, tags, worldgen, structures, classes and mixin configs. No decompiling. Classification uses the reviewed table first (`docs/modpacks/atm10-mods.csv`, included in the binary), then rules on categories, sides and the census. Each mod gets a dependency layer. It writes `inventory.json` and `inventory.csv` (the ATM10 CSV's columns plus `layer`). It downloads metadata only and never fetches jars. ## On a real pack Create+ 6.0.0 alpha f is NeoForge 21.1.233 with 155 files. Only its `.mrpack` metadata was downloaded, into its own `/tmp` folder: ``` Create+ (mrpack): Minecraft 1.21.1, neoforge 21.1.233; files {"mods": 150, "resourcepacks": 5}; overrides {... "config": 272, "dynamic-resource-pack-cache": 396, "mods": 28 ...} 155 files, 0 jars read class: content 54, library 33, client-ui 26, performance 25, other 14, unknown 2, server-only 1 tier: none 62, client 26, data 19, machines 17, deep 16, logic 15 confidence: categories 80, known 40, sides 21, guess 7, kind 5, unknown 2 source: modrinth 154, file 1 layers: [93, 57, 5] 4 required dependencies are not in the pack (Fabric API, which Sinytra Connector provides) ``` The two unknowns are `ballastmod` and `map_atlases`. Both are on Modrinth without categories that decide a class. 40 rows matched the ATM10 table by id, slug or name. ## Size About 1,000 lines with tests, over the usual ~500. The CLI, import, metadata and classification only work together. Carry-over is a separate PR stacked on this one. ## Checks - `cargo fmt --all --check` passes, and `cargo clippy --workspace --all-targets -- -D warnings` passes. - `cargo test -p horizon-port-pack` passes (8 tests: the mrpack and CurseForge readers, `mods.toml` and `fabric.mod.json`, the census, the known table, the rules and the layers). - Local parity: results will follow in a comment. 🤖 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:57:45 +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#2629
No description provided.