creat-id

an api for AE2-lunyi

== Overview ==
creat-id is a read-only recipe-index library mod (LIB type). On server startup it scans all recipes and builds an index over
recipe id / output / input / slots, then exposes it to other mods through a reflection-based API.
It adds no blocks or items and modifies no recipes.
The pattern validation feature of AE2-Lunyi relies on this mod.

== Features ==
* Read-only: adds no blocks or items, modifies no recipes
* Automatic rebuild: scanned once on server startup; rebuilt after a datapack reload
* Multi-dimensional index: query by recipe id, output, input, or slot (including fluid amounts in mB)
* Cross-mod compatibility: reflectively unwraps each mod's custom input / fluid wrappers, with no compile-time dependency
* Exportable: writes the index as TSV, making it easy to diagnose "why does this pattern fail validation"

== Installation ==
1. Minecraft 1.21.1 + NeoForge 21.1.x
2. Put creat_id-*.jar into the mods folder
3. Installing it alone adds no game content; when used with AE2-Lunyi it acts as the data source for pattern validation

== Supported mods ==
Custom unwrapping has been implemented for the following non-standard recipe structures:
* Create: ingredients / fluidIngredients / sequences; fluids recorded in mB; sequence-assembly transitional items excluded
* Industrial Foregoing: input / inputFluid / output / outputFluid
* Modern Industrialization: MachineRecipe.fluidInputs
* Oritech: custom FluidIngredient (fluidContent + amount)
* Actually Additions: crafting table base + modifiers
* Ender IO: soul binder entityType()
* Draconic Evolution: fusion recipe getCatalyst()
* Mystical Agriculture: infusion crystal treated as a non-consumed catalyst

Other mods use the generic reflection path: field scanning walks the whole superclass chain, unwraps
SizedIngredient / SizedFluidIngredient, and supports accessor names without a "get" prefix (e.g. inputItems / inputFluid).

== Commands ==
/recipes count            Show the total number of indexed recipes
/recipes find <item>      Show which recipes produce an item
/recipes inputs <item>    Show which ingredients a recipe for an item requires
/recipes dump [namespace] Export to logs/recipes-<namespace>-<time>.tsv

The exported TSV columns are: id, type, inputs, outputs, slots.
The slots column records ingredients per slot; a|b#n means the slot accepts a or b, with amount n (fluids in mB).

== Using it as an API ==
This mod exposes a simplified interface via reflection, so other mods need no compile-time dependency:
* produces(itemId): whether any recipe produces the item
* producersOf(itemId): list of recipe ids producing the item
* inputsOf(recipeId): flattened list of input ids for a recipe
* slotsOf(recipeId): slot list for a recipe (including fluid mB amounts)
* outputsOf(recipeId): output id list for a recipe
* outputAmountsOf(recipeId): output amounts for a recipe

When this mod is not installed, callers should degrade gracefully; AE2-Lunyi falls back to "no validation" automatically.

== Requirements and versions ==
* Minecraft 1.21.1 / NeoForge 21.1.x
* No mandatory dependencies
* Optional pairing: AE2-Lunyi (uses the validation feature)
* License: MIT

== FAQ ==
Q: What changes if I install this mod alone?
A: No visible in-game content changes; it only provides recipe data to other mods.

Q: Why is it needed?
A: AE2-Lunyi's pattern validation needs to know which recipe produces a given item; this mod builds and serves that index.

Q: When is the index updated?
A: Once on server startup, and rebuilt automatically after a datapack reload (/reload).

Q: How do I diagnose a pattern that fails validation?
A: Use /recipes inputs <item> to see the required ingredients and compare them with your pattern; use dump to export the TSV for details.

creat-id Team

profile avatar
Owner
  • 2
    Projects
  • 22
    Downloads

More from yhaa233