Skip to content

feat: support mio_icif Metal Former aggregate generation - #30

Merged
Fodoth-jinzi89 merged 4 commits into
LangQi99:mainfrom
Fodoth-jinzi89:codex/release-0.2.3
Nov 8, 2026
Merged

Fodoth-jinzi89 merged 4 commits into
LangQi99:mainfrom
Fodoth-jinzi89:codex/release-0.2.3

Conversation

@Fodoth-jinzi89

Copy link
Copy Markdown
Collaborator

Adds first-class support for mio_icif's 金属成型机 (Metal Former / Advanced Metal Former), so the All Pattern Generator captures the recipes of the machine's currently selected mode.

What changed

New compat/mioicif adapter. MioIcifMetalFormerAdapter matches the machine by its block ids (mio_icif:producer/block_metal_former[_advanced]), reads the live mode (getMode() → ROLLING/CUTTING/EXTRUDING) and discovers that mode's recipe type (mio_icif:metal_former_rolling / _cutting / _extruding). The per-recipe accessors (getIngredient, getResult, getIngredientCount, getProcessingTime) are read reflectively, so the adapter compiles and loads with no compile-time dependency on mio_icif — its jar is not published to any maven and is not committed, and CI builds from a clean checkout. Input/output transfer uses the NeoForge item-handler capability with a vanilla WorldlyContainer fallback.

Catalog cache fix — why mode switching appeared to do nothing. The discovered catalog was cached by adapter.id() + block-entity type only. That key is a constant for a machine whose recipe set depends on mutable state, so the first catalog built (the default mode, rolling) was reused for every metal former and every mode until a datapack reload. This is the reported symptom: every generated aggregate contained rolling recipes. MachineAdapter.catalogVariant() now supplies that state and feeds both the RecipeIndexService cache key and the AggregatePatternLibrary variant, so the three modes keep separate catalogs instead of the first one being reused or overwritten in place.

Startup refresh guard. Catalogs carrying a machine-state variant are excluded from the position-less world-entry refresh, which cannot read the mode — the same reasoning already applied to the Mekanism rotary condensentrator.

i18n + docs. Localized the mode variants (aeallpattern.variant.ROLLING / CUTTING / EXTRUDING) for en_us / zh_cn / zh_tw, and documented the integration in the README compatibility tables, the support matrix and the GameTest mod/class matrix.

Verification

  • ./gradlew check (compile, unit tests, verifyReleaseMetadata, verifyReleaseJar) passes.
  • New unit test covers the mode → recipe-type mapping and the block matcher.
  • mio_icif is not part of any CI profile, so runtime verification needs the mod installed. The adapter's targets — block ids, the getMode() accessor, the recipe accessors and the three recipe-type ids — were each verified against the mio_icif jar.

Note for the reviewer

The variant mechanism this reuses already existed for the rotary condensentrator, but was only wired into the client-scan path; this change promotes it to the adapter contract so the generator-item path gets it too.

Fodoth-jinzi89 and others added 4 commits September 12, 2026 23:23
Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
Add a reflection-based MachineAdapter for mio_icif's 金属成型机 (Metal Former / Advanced Metal Former). It discovers the recipe type of the machine's currently selected mode (rolling/cutting/extruding) via the mod's own recipe types and recipe accessors, with no compile-time dependency on mio_icif.

Fix the catalog cache so a machine-state-dependent recipe set is not shared: MachineAdapter.catalogVariant() now feeds both the RecipeIndexService cache key and the AggregatePatternLibrary variant, so the three modes keep separate catalogs instead of the first one being reused or overwritten. State-dependent catalogs are also excluded from the position-less startup refresh, which cannot read the mode.

Localize the metal former mode variants (en_us/zh_cn/zh_tw) and document the integration (README compatibility tables, support matrix, GameTest mod/class matrix entry).

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
@Fodoth-jinzi89
Fodoth-jinzi89 merged commit 20e4321 into LangQi99:main Nov 8, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant