Expand description
Recipe preview and execution on a copy, committed only after all costs and outputs fit.
Structs§
- Craft
Preview - An owned snapshot of crafting availability and missing ingredients.
- Missing
Ingredient - One missing ingredient, aggregated across every input with the same item ID.
See
previewfor an example. Amounts useu64so up to 32u32costs remain exact even when the required total exceeds inventory stack limits.
Functions§
- craft
- Inputs/outputs are host-authored trusted recipe data, never client prices.
Repeated ingredients are summed by sequential removal. At most 32 of each.
Output capacity is evaluated after consuming inputs, allowing slot reuse.
See
previewfor a non-mutating availability check and usage example. - preview
- Inspect the same trusted recipe accepted by
craftwithout changing inventory.