[PR #1230] [MERGED] port-pack: check one mod jar (Works, Partly, Doesn't run) from its content and classes #3438

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

📋 Pull Request Information

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

Base: main ← Head: feat/modbrowser-java-verdicts


📝 Commits (3)

  • da996b9 port-pack: check one mod jar (Works, Partly, Doesn't run) from its content and classes
  • 4a350bb port-pack carry: leave out recipes for items it didn't declare
  • 9ae041c Merge origin/main into feat/modbrowser-java-verdicts

📊 Changes

6 files changed (+1176 additions, -1 deletions)

View changed files

📝 crates/horizon-port-pack/src/carry.rs (+89 -0)
➕ crates/horizon-port-pack/src/check.rs (+411 -0)
➕ crates/horizon-port-pack/src/classes.rs (+642 -0)
📝 crates/horizon-port-pack/src/lib.rs (+2 -0)
📝 crates/horizon-port-pack/src/main.rs (+16 -1)
📝 docs/modpacks.md (+16 -0)

📄 Description

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

Step 1 of brief modbrowser-java-1 (Java mods in the mod browser), part 1 of 2: the analysis. The launcher PR that follows shows this verdict on each Java mod before install, and installs the carry this writes.

What

horizon-port-pack check <jar> <out>, and horizon_port_pack::check::check:

  • carries the jar into <out>/carry/ (the existing carry, no oracle: templates from blockstate properties), the folder content mod an install copies;
  • reads its class files (classes.rs: constant pool, superclass, interfaces, declared methods; no decompiling, no running) and follows each mod class up to the first game class it extends: block entity, menu, entity, screen, renderer, worldgen, recipe type, effect, particle, network payload; a block or item subclass counts only when it overrides behaviour (a block that overrides only getStateForPlacement, rotate, codec... is registration, and shape-only overrides are listed apart); Mixins and game-event subscriptions (NeoForge bus, Fabric callbacks; registration events left out) are counted;
  • writes the verdict to <out>/check.json: Works (content only), Partly (content ports, the listed code features don't), Doesn't run (nothing to port, a jar made for 1.20 or older, or one carry refuses), with "ports" and "skipped" lines the UI shows.

The carry also leaves out recipes whose result is one of the mod's own items it didn't declare (a block with no vanilla template): they loaded and crafted air. It moves them to outside/, lists them (recipes_unregistered), and the check says "N recipes for left-out blocks". Found by the end-to-end run of the mod browser (Macaw's curved gates).

Game classes are read by Mojang's names (26.1+ ships unobfuscated; NeoForge since 1.20.5). Fabric jars before 26.1 use intermediary names, and a class extending one counts as unread code (conservative: such mods are at best Partly).

Measured (Mac mini, debug build, ten 26.3 jars from Modrinth)

Jar Verdict Ports Main skips Time
Macaw's Fences (Fabric) Partly 166 blocks, 208 recipes 32 blocks without a template (and their 32 recipes), 5 blocks with behaviour 0.9 s
Macaw's Windows (NeoForge) Partly 61 blocks, 353 recipes 303 blocks without a template 2.6 s
Macaw's Furniture Partly 368 blocks, 778 recipes 408 blocks without a template, 2 block entities, 1 menu 3.4 s
Ecologics Partly 110 blocks, 136 recipes, 37 worldgen 16 entities, 9 Mixins, 32 custom recipes 2.0 s
Compressed Blocks Partly 3,670 blocks, 9,360 recipes 3 blocks, 1 item with behaviour 24 s
More Decorative Blocks Partly 3,883 blocks, 4,426 recipes 575 blocks without a template 27 s
Moog's Nether Structures Partly 750 worldgen files 1 Java processor 0.8 s
Sodium Doesn't run (3 textures) 83 Mixins, renderers 0.5 s
GeckoLib Doesn't run nothing 17 Mixins, renderers 0.2 s
Fabric API Doesn't run carry refuses the id fabric-api 0.02 s

The big jars' time is writing the carry (tens of thousands of small JSON files); the launcher runs checks in the background and caches them.

Self-check

  • cargo fmt, cargo clippy -p horizon-port-pack --all-targets -- -D warnings: clean
  • cargo test -p horizon-port-pack: 63 passed (new: recipes for left-out blocks, class-file parsing, chains to the game, registration vs behaviour, Works/Partly/No and old layouts on built jars)
  • tools/parity.py --changed origin/main: 0 of 327 harnesses depend on these files (the crate isn't in the game)

Needs Ludovic

Nothing for this PR.

🤖 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/1230 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/modbrowser-java-verdicts` --- ### 📝 Commits (3) - [`da996b9`](https://github.com/horizon-rust/horizon/commit/da996b9fd13e02ab3e758393b6d428d4ef6f07d0) port-pack: check one mod jar (Works, Partly, Doesn't run) from its content and classes - [`4a350bb`](https://github.com/horizon-rust/horizon/commit/4a350bb0a03c64b34245ddd5e3f526de305988f2) port-pack carry: leave out recipes for items it didn't declare - [`9ae041c`](https://github.com/horizon-rust/horizon/commit/9ae041ccd3a2e674616503eae5008a5125d61496) Merge origin/main into feat/modbrowser-java-verdicts ### 📊 Changes **6 files changed** (+1176 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-port-pack/src/carry.rs` (+89 -0) ➕ `crates/horizon-port-pack/src/check.rs` (+411 -0) ➕ `crates/horizon-port-pack/src/classes.rs` (+642 -0) 📝 `crates/horizon-port-pack/src/lib.rs` (+2 -0) 📝 `crates/horizon-port-pack/src/main.rs` (+16 -1) 📝 `docs/modpacks.md` (+16 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Step 1 of brief modbrowser-java-1 (Java mods in the mod browser), part 1 of 2: the analysis. The launcher PR that follows shows this verdict on each Java mod before install, and installs the carry this writes. ## What `horizon-port-pack check <jar> <out>`, and `horizon_port_pack::check::check`: - carries the jar into `<out>/carry/` (the existing `carry`, no oracle: templates from blockstate properties), the folder content mod an install copies; - reads its class files (`classes.rs`: constant pool, superclass, interfaces, declared methods; no decompiling, no running) and follows each mod class up to the first game class it extends: block entity, menu, entity, screen, renderer, worldgen, recipe type, effect, particle, network payload; a block or item subclass counts only when it overrides behaviour (a block that overrides only `getStateForPlacement`, `rotate`, `codec`... is registration, and shape-only overrides are listed apart); Mixins and game-event subscriptions (NeoForge bus, Fabric callbacks; registration events left out) are counted; - writes the verdict to `<out>/check.json`: **Works** (content only), **Partly** (content ports, the listed code features don't), **Doesn't run** (nothing to port, a jar made for 1.20 or older, or one carry refuses), with "ports" and "skipped" lines the UI shows. The carry also leaves out recipes whose result is one of the mod's own items it didn't declare (a block with no vanilla template): they loaded and crafted air. It moves them to `outside/`, lists them (`recipes_unregistered`), and the check says "N recipes for left-out blocks". Found by the end-to-end run of the mod browser (Macaw's curved gates). Game classes are read by Mojang's names (26.1+ ships unobfuscated; NeoForge since 1.20.5). Fabric jars before 26.1 use intermediary names, and a class extending one counts as unread code (conservative: such mods are at best Partly). ## Measured (Mac mini, debug build, ten 26.3 jars from Modrinth) | Jar | Verdict | Ports | Main skips | Time | |---|---|---|---|---| | Macaw's Fences (Fabric) | Partly | 166 blocks, 208 recipes | 32 blocks without a template (and their 32 recipes), 5 blocks with behaviour | 0.9 s | | Macaw's Windows (NeoForge) | Partly | 61 blocks, 353 recipes | 303 blocks without a template | 2.6 s | | Macaw's Furniture | Partly | 368 blocks, 778 recipes | 408 blocks without a template, 2 block entities, 1 menu | 3.4 s | | Ecologics | Partly | 110 blocks, 136 recipes, 37 worldgen | 16 entities, 9 Mixins, 32 custom recipes | 2.0 s | | Compressed Blocks | Partly | 3,670 blocks, 9,360 recipes | 3 blocks, 1 item with behaviour | 24 s | | More Decorative Blocks | Partly | 3,883 blocks, 4,426 recipes | 575 blocks without a template | 27 s | | Moog's Nether Structures | Partly | 750 worldgen files | 1 Java processor | 0.8 s | | Sodium | Doesn't run | (3 textures) | 83 Mixins, renderers | 0.5 s | | GeckoLib | Doesn't run | nothing | 17 Mixins, renderers | 0.2 s | | Fabric API | Doesn't run | carry refuses the id `fabric-api` | | 0.02 s | The big jars' time is writing the carry (tens of thousands of small JSON files); the launcher runs checks in the background and caches them. ## Self-check - `cargo fmt`, `cargo clippy -p horizon-port-pack --all-targets -- -D warnings`: clean - `cargo test -p horizon-port-pack`: 63 passed (new: recipes for left-out blocks, class-file parsing, chains to the game, registration vs behaviour, Works/Partly/No and old layouts on built jars) - `tools/parity.py --changed origin/main`: 0 of 327 harnesses depend on these files (the crate isn't in the game) ## Needs Ludovic Nothing for this PR. 🤖 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:09:32 +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#3438
No description provided.