# ๐Ÿ”Œ Recipe Provider Port used by [[๐Ÿงพ Recipe Resolution]]. The domain asks: *what materials produce this many of this item?* Infrastructure answers. The domain never imports a recipe mod. --- ## Shape ```text RecipeProvider resolve(ItemId target, int quantity) โ†’ list of MaterialRequirement ``` `ItemId` is `namespace:path` (e.g. `minecraft:furnace`). Not `net.minecraft.world.item.Item`. `MaterialRequirement` is `(ItemId, quantity)`. --- ## Contract | Case | Result | |------|--------| | `quantity < 1` | Empty list | | Item has a recipe | **One crafting level** of ingredients, already scaled for `quantity` (including recipe output count) | | Item has no recipe | One requirement: `(target, quantity)` โ€” a gather | | Several recipes exist | Provider picks **one**. Recipe choice is not in the slice | | Ingredient is a tag | Provider returns **concrete** ItemIds. Tags are not a domain type yet | Not a recipe tree. Not a recipe browser. Dependency chains are an expanded view, not this port. --- ## First implementation: stub `StubRecipeProvider` in `infrastructure.recipe`. In-memory table of a few shaped recipes plus the identity fallback. Enough to drive Furnace / Crafting Bench / Chest in the overlay. Not vanilla-complete. Not EMI. Later implementations (not this slice): `EmiRecipeProvider`, `JeiRecipeProvider`, `ReiRecipeProvider`, `VanillaRecipeProvider`. If a recipe mod disappears, only the adapter changes. See ADR-003, ADR-014. --- ## Who calls it [[๐Ÿ“ˆ Progress Calculation]] (via [[๐Ÿงพ Recipe Resolution]]): ```text remaining = max(0, goal.quantity โˆ’ available(goal.item)) requirements = RecipeProvider.resolve(goal.item, remaining) ``` Then aggregate. Then `Missing = Required โˆ’ Available`. Owned finished goods reduce **how many to resolve**. They are not subtracted again from ingredients. --- ## Related Documents [[๐Ÿงพ Recipe Resolution]] [[๐Ÿงฑ Material Requirement]] [[๐Ÿ“ˆ Progress Calculation]] [[๐Ÿ›๏ธ Architecture]] [[๐Ÿ“ฆ Packages]] [[๐Ÿ“ Decisions]] [[๐ŸŽฏ Goal]]