horizon-port-pack carry: a jar's data and assets as a content mod

carry <work> [<mod id>...] turns each content mod with a jar into a folder
content mod (API 0.2) in <work>/mods/<id>/carry/, for local use:

- assets/<id>/, data/<id>/ and data/minecraft/tags/ are copied; other
  namespaces and vanilla data go to outside/ for review; no class file is
  copied.
- Vanilla-type recipes get 26.3 ingredients ("id", "#tag", lists);
  custom types and NeoForge conditions are kept and listed.
- Item models get the items/ client definitions 1.21.4 introduced.
- Each block is declared from a vanilla template guessed from its
  blockstate properties; unknown property sets are listed. Items
  without a block are declared from minecraft:stick.

The test builds a small NeoForge jar, carries it over, and reads the
result with horizon-mods' own Content reader.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ludovic Marie
2026-10-16 19:25:28 +02:00
parent 85858610bf
commit 673ac84724
5 changed files with 506 additions and 4 deletions
+11 -1
View File
@@ -262,11 +262,12 @@ inspected:
└── coverage.json, coverage.md
```
**Status.** `import` and `inventory` run today, `carry` follows (see below):
**Status.** `import`, `inventory` and `carry` run today:
```
cargo run -p horizon-port-pack -- import ~/Downloads/pack.mrpack ~/.horizon/ports/pack
cargo run -p horizon-port-pack -- inventory ~/.horizon/ports/pack # --offline reuses modrinth.json
cargo run -p horizon-port-pack -- carry ~/.horizon/ports/pack # content mods with a jar, or name them
```
`inventory` reads metadata only: Modrinth answers by file hash, and the jars only if the user's
@@ -276,6 +277,15 @@ classes come from the reviewed table, Modrinth categories and sides; with jars,
only): content 54, library 33, client-ui 26, performance 25, other 14, unknown 2, server-only 1;
40 rows matched the reviewed ATM10 table; three dependency layers (93 / 57 / 5).
`carry` copies a jar's `assets/<id>/`, `data/<id>/` and `data/minecraft/tags/` into
`mods/<id>/carry/`, a folder content mod (API 0.2) the game loads with `--dev-mod`, and keeps
what a content mod may not hold (other namespaces such as `c` tags, vanilla data) in `outside/`.
No class file is copied. It upgrades vanilla-type recipes from 1.21.1 ingredients to 26.3's,
adds the `items/` definitions 1.21.4 introduced, and declares each block from a vanilla template
guessed from its blockstate properties (stone for none, a door for `facing, half, hinge, open,
powered`, ...); blocks with an unknown property set, custom recipe types and NeoForge
conditions are listed in `carry-report.json` for the oracle step.
### 1. Import
| Format | Read | Jars come from |