Repository navigation
feat: support mio_icif Metal Former aggregate generation - #30
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/mioicifadapter.MioIcifMetalFormerAdaptermatches 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 vanillaWorldlyContainerfallback.Catalog cache fix — why mode switching appeared to do nothing. The discovered catalog was cached by
adapter.id() + block-entity typeonly. 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 theRecipeIndexServicecache key and theAggregatePatternLibraryvariant, 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.getMode()accessor, the recipe accessors and the three recipe-type ids — were each verified against the mio_icif jar.Note for the reviewer
The
variantmechanism 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.