[GH-ISSUE #1854] [mods] Code mods: the gap ranking, a proven first port, and which path to take #555

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

Originally created by @socksprox on GitHub (Oct 25, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/1854

🤖 Filed by socksprox's AI agent (Devin), not by socksprox.

The question

ATM10's world already generates well in Horizon (structures, ores, decoration blocks), but 333 of its 496 mods are still "not yet" — and almost all of them have code: machines, magic, mobs, tools. This issue lays out the modding path for those code mods: which pieces of the mod API unlock the most of them, what a first real port looks like, and what it costs. The full research spike lives in docs/research/code-mods-plan.md on feat/codemods-1, with per-mod data in docs/modpacks/atm10-code-gaps.csv (metadata only).

The premise stays as decided in #527 and docs/modpacks.md: porting, not emulation. Java jars can't run — Mixin-style patches have no net.minecraft classes to bind to in a Rust reimplementation. Mods become native Horizon mods (Rust → WebAssembly against the mod API), ported from observed behaviour, data files and public docs, each checked tick-by-tick against a dev-only NeoForge oracle. Mod code never enters this repository.

What the mod API carries today

Line What a mod can do
API 0.1 (code) client side only: read the player and the clock, chat lines and a HUD panel, small files, chat commands, tick/frame/chat hooks
API 0.2 (content) blocks and items as data copying a vanilla template; recipes, loot, tags, models, textures, lang, worldgen JSON
API 0.4 preview block entities for the mod's own blocks: game-owned slots and block state, one batched tick per mod, saved state, menu data values, the game's item/fuel/cooking-recipe facts

Code still cannot touch the world, and the sandbox stays: memory cap, fuel per call, no files/sockets/processes, player-visible capabilities.

The gaps, ranked

Each gap is a piece of API plus the game wiring behind it:

Gap Meaning Mods that need it (of 307 code mods)
T ticking block entities with saved state 162
N client↔server mod packets 148
D custom rendering (block-entity renderers, animated models) 145
M menus and screens (declared layouts, server click logic) 140
V inventories (hoppers, pipes, menus, drops; per-side slot rules) 124
I item behaviour hooks 93
B block behaviour hooks 71
C energy/fluid/item transfer between blocks 69
X entities and AI 69
E server events, player data, config 47
R custom recipe types + viewer layout 44
U client UI interfaces 42
H named vanilla hooks (what a Mixin does, added to the engine) 33
W dimensions and worldgen code 18
A accessory slots (Curios) 13
S embedded scripting VM (CC: Tweaked-style) 8

Filling them cheapest-first, a mod is unlocked when every gap it needs is filled plus the mods it requires:

Step Adds Mods unlocked (total) Players notice
1–3 U client UI, N networking, B/I/E/H logic hooks 67 JEI, Jade, JourneyMap — better built into Horizon than ported
4–7 T/V/M machines core, D rendering, C transfer, R recipe types 189 AE2, Refined Storage, Sophisticated Storage, Waystones, Farmer's Delight, Mystical Agriculture, FTB Quests
8–11 X entities, W dimensions, A accessories, S scripting 307 Create, Mekanism, Ars Nouveau, Apotheosis, Twilight Forest, Iron's Spells, Supplementaries, Allthemodium

Takeaways: block entities are the backbone of the big tier (the T+V+M+D+C+R stack takes unlocked mods from 67 to 189); rendering is the hidden gate (110 block-entity mods also draw something of their own — a data-driven first step covers most without arbitrary draw code); entities are the last step to the flagships.

Licences of the 307: 84 permissive, 33 copyleft, 39 ARR, 16 custom, 7 restricted, 128 unknown. Ports stay local whatever the licence; only permissive/copyleft ones could ever be published.

Proof of concept: the Iron Furnaces port

Iron Furnaces (10.1M Modrinth downloads, Apache-2.0) is the most-downloaded ATM10 mod whose gaps are exactly the most common machine set (T+V+M+N). The spike ported its iron furnace in furnace mode (~200 lines of Rust) against the API 0.4 machine/block-entities interface, and a harness compared it against the real mod on a dev-only NeoForge server:

Scenarios Ticks compared Equal
7 (coal/lava/stick fuel, slot fill, input swaps, no-recipe, sponge into bucket) 3,760 3,760

The same port with the tier speed set to vanilla's 200 instead of 160 differs from the first tick — the harness catches real drift, not just crashes.

Not done yet: the game doesn't create/tick/save mod block entities in a world (generic wiring is next), the menu needs M, other furnace modes need C.

What porting costs

Measured on this slice: once the API exists, a machine of this size costs under an hour of agent time and the harness passed first run. A whole small mod (all tiers, modes, menus) is ~1–2 agent-days; flagships like Mekanism, AE2 or Create are campaigns of weeks each.

The API gaps cost more than the ports (agent-days, including game wiring and harnesses):

Gap Est.
T/V game wiring (create, tick, save, drop, hoppers, slot rules) 3–4
M menus and screens 4–6
N networking 2–3
B/I/E/H logic hooks 4–6, then ~0.5 per new hook
C transfer capabilities 3–5
R recipe types 3–4
U client UI 5–8
D rendering 10–15 (the biggest)
X entities and AI 10–15
W dimensions 8–12
A accessory slots 2–3

Agents can automate: classification, jar fetching/decompiling, data and asset carry-over, writing the port, generating scenarios, running oracle + harness until green. Agents cannot: decide to publish ports or contact authors (the maintainer's call, licences permitting), design engine hooks alone, judge visual parity of renderers, or track mod updates.

Options for the maintainer

Option Gaps Unlocks (of 307) Gap cost (agent-days)
A. Machines first B/I/E/H, then T/V wiring, M, N, D, C, R 148, incl. AE2, Refined Storage, Sophisticated Storage, Waystones, Farmer's Delight, Mystical Agriculture 30–45
B. Cheap gaps first U, N, B/I/E/H 67, mostly small QoL mods 12–20
A + B all of the above 189 35–50
C. One flagship vertical everything Create needs, then Create Create + 12 add-ons, most of A on the way 35–55, then weeks for the port
D. Stop at data none — packs stay worldgen/decoration/ores 0 0

The machine stack alone (without the logic hooks) unlocks only 53 mods — most machines also need items and blocks that do something on use.

Which path? Option A seems like the best ratio of player-visible wins to cost. Happy to break any gap into its own issue once a direction is picked.

Originally created by @socksprox on GitHub (Oct 25, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/1854 > 🤖 Filed by socksprox's AI agent (Devin), not by socksprox. ## The question ATM10's world already generates well in Horizon (structures, ores, decoration blocks), but **333 of its 496 mods are still "not yet"** — and almost all of them have code: machines, magic, mobs, tools. This issue lays out the modding path for those code mods: which pieces of the mod API unlock the most of them, what a first real port looks like, and what it costs. The full research spike lives in `docs/research/code-mods-plan.md` on `feat/codemods-1`, with per-mod data in `docs/modpacks/atm10-code-gaps.csv` (metadata only). The premise stays as decided in #527 and `docs/modpacks.md`: **porting, not emulation**. Java jars can't run — Mixin-style patches have no `net.minecraft` classes to bind to in a Rust reimplementation. Mods become native Horizon mods (Rust → WebAssembly against the mod API), ported from observed behaviour, data files and public docs, each checked tick-by-tick against a dev-only NeoForge oracle. Mod code never enters this repository. ## What the mod API carries today | Line | What a mod can do | |---|---| | API 0.1 (code) | client side only: read the player and the clock, chat lines and a HUD panel, small files, chat commands, tick/frame/chat hooks | | API 0.2 (content) | blocks and items as data copying a vanilla template; recipes, loot, tags, models, textures, lang, worldgen JSON | | API 0.4 preview | block entities for the mod's own blocks: game-owned slots and block state, one batched tick per mod, saved state, menu data values, the game's item/fuel/cooking-recipe facts | Code still cannot touch the world, and the sandbox stays: memory cap, fuel per call, no files/sockets/processes, player-visible capabilities. ## The gaps, ranked Each gap is a piece of API plus the game wiring behind it: | Gap | Meaning | Mods that need it (of 307 code mods) | |---|---|---:| | T | ticking block entities with saved state | **162** | | N | client↔server mod packets | 148 | | D | custom rendering (block-entity renderers, animated models) | 145 | | M | menus and screens (declared layouts, server click logic) | 140 | | V | inventories (hoppers, pipes, menus, drops; per-side slot rules) | 124 | | I | item behaviour hooks | 93 | | B | block behaviour hooks | 71 | | C | energy/fluid/item transfer between blocks | 69 | | X | entities and AI | 69 | | E | server events, player data, config | 47 | | R | custom recipe types + viewer layout | 44 | | U | client UI interfaces | 42 | | H | named vanilla hooks (what a Mixin does, added to the engine) | 33 | | W | dimensions and worldgen code | 18 | | A | accessory slots (Curios) | 13 | | S | embedded scripting VM (CC: Tweaked-style) | 8 | Filling them cheapest-first, a mod is *unlocked* when every gap it needs is filled plus the mods it requires: | Step | Adds | Mods unlocked (total) | Players notice | |---|---|---:|---| | 1–3 | U client UI, N networking, B/I/E/H logic hooks | 67 | JEI, Jade, JourneyMap — better built into Horizon than ported | | 4–7 | T/V/M machines core, D rendering, C transfer, R recipe types | 189 | AE2, Refined Storage, Sophisticated Storage, Waystones, Farmer's Delight, Mystical Agriculture, FTB Quests | | 8–11 | X entities, W dimensions, A accessories, S scripting | 307 | Create, Mekanism, Ars Nouveau, Apotheosis, Twilight Forest, Iron's Spells, Supplementaries, Allthemodium | Takeaways: **block entities are the backbone of the big tier** (the T+V+M+D+C+R stack takes unlocked mods from 67 to 189); **rendering is the hidden gate** (110 block-entity mods also draw something of their own — a data-driven first step covers most without arbitrary draw code); **entities are the last step to the flagships**. Licences of the 307: 84 permissive, 33 copyleft, 39 ARR, 16 custom, 7 restricted, 128 unknown. Ports stay local whatever the licence; only permissive/copyleft ones could ever be published. ## Proof of concept: the Iron Furnaces port Iron Furnaces (10.1M Modrinth downloads, Apache-2.0) is the most-downloaded ATM10 mod whose gaps are exactly the most common machine set (T+V+M+N). The spike ported its iron furnace in furnace mode (~200 lines of Rust) against the API 0.4 `machine`/`block-entities` interface, and a harness compared it against the real mod on a dev-only NeoForge server: | Scenarios | Ticks compared | Equal | |---|---:|---:| | 7 (coal/lava/stick fuel, slot fill, input swaps, no-recipe, sponge into bucket) | 3,760 | **3,760** | The same port with the tier speed set to vanilla's 200 instead of 160 differs from the first tick — the harness catches real drift, not just crashes. Not done yet: the game doesn't create/tick/save mod block entities in a world (generic wiring is next), the menu needs M, other furnace modes need C. ## What porting costs Measured on this slice: **once the API exists, a machine of this size costs under an hour of agent time** and the harness passed first run. A whole small mod (all tiers, modes, menus) is ~1–2 agent-days; flagships like Mekanism, AE2 or Create are campaigns of weeks each. The API gaps cost more than the ports (agent-days, including game wiring and harnesses): | Gap | Est. | |---|---:| | T/V game wiring (create, tick, save, drop, hoppers, slot rules) | 3–4 | | M menus and screens | 4–6 | | N networking | 2–3 | | B/I/E/H logic hooks | 4–6, then ~0.5 per new hook | | C transfer capabilities | 3–5 | | R recipe types | 3–4 | | U client UI | 5–8 | | D rendering | 10–15 (the biggest) | | X entities and AI | 10–15 | | W dimensions | 8–12 | | A accessory slots | 2–3 | Agents can automate: classification, jar fetching/decompiling, data and asset carry-over, writing the port, generating scenarios, running oracle + harness until green. Agents cannot: decide to publish ports or contact authors (the maintainer's call, licences permitting), design engine hooks alone, judge visual parity of renderers, or track mod updates. ## Options for the maintainer | Option | Gaps | Unlocks (of 307) | Gap cost (agent-days) | |---|---|---:|---:| | **A. Machines first** | B/I/E/H, then T/V wiring, M, N, D, C, R | 148, incl. AE2, Refined Storage, Sophisticated Storage, Waystones, Farmer's Delight, Mystical Agriculture | 30–45 | | B. Cheap gaps first | U, N, B/I/E/H | 67, mostly small QoL mods | 12–20 | | A + B | all of the above | 189 | 35–50 | | C. One flagship vertical | everything Create needs, then Create | Create + 12 add-ons, most of A on the way | 35–55, then weeks for the port | | D. Stop at data | none — packs stay worldgen/decoration/ores | 0 | 0 | The machine stack alone (without the logic hooks) unlocks only 53 mods — most machines also need items and blocks that do something on use. **Which path?** Option A seems like the best ratio of player-visible wins to cost. Happy to break any gap into its own issue once a direction is picked.
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#555
No description provided.