Replace the empty flat docs with the Media Farm shelf layout: vision, philosophy, language, architecture (including packages, RecipeProvider, and Create Goal), player day, and prototype freezes. The NeoForge example code is still not the architecture.
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
# ▶️ Create Goal
|
||||
|
||||
First use case. Application layer. It does not contain domain rules; it uses [[🎯 Goal]] invariants.
|
||||
|
||||
Capture (hover → `+ Add to Crafting Goals`) is one caller. The use case does not know about inventory screens.
|
||||
|
||||
---
|
||||
|
||||
## Input
|
||||
|
||||
- `ItemId` (the item the player pointed at)
|
||||
|
||||
## Output
|
||||
|
||||
- The plan’s goals
|
||||
- Refresh of missing materials (via [[📈 Progress Calculation]])
|
||||
|
||||
## Quantity
|
||||
|
||||
Always **1** on this path. New goal: quantity 1. Existing goal: quantity + 1.
|
||||
|
||||
---
|
||||
|
||||
## Flow
|
||||
|
||||
```text
|
||||
CreateGoal(item)
|
||||
↓
|
||||
Goal exists for this ItemId?
|
||||
yes → quantity += 1
|
||||
no → add Goal(item, 1)
|
||||
↓
|
||||
RefreshProgress
|
||||
remaining per goal = qty − available(item)
|
||||
resolve remaining through RecipeProvider
|
||||
aggregate
|
||||
missing = required − available
|
||||
```
|
||||
|
||||
Persistence: none in this slice. The list lives in memory.
|
||||
|
||||
---
|
||||
|
||||
## Sibling use cases (same slice)
|
||||
|
||||
Needed so Screen 2’s `[+]`, `[-]`, and Clear are not invented in the UI.
|
||||
|
||||
| Use case | Input | Result |
|
||||
|----------|-------|--------|
|
||||
| **Adjust Goal Quantity** | ItemId, delta +1 | Quantity + 1, then RefreshProgress |
|
||||
| **Remove Goal** | ItemId | Goal gone, then RefreshProgress |
|
||||
| **Clear Goals** | — | All goals gone, then RefreshProgress |
|
||||
| **Refresh Progress** | — | Recompute missing list from current goals + inventory |
|
||||
|
||||
`[-]` on the overlay: if quantity > 1, Adjust −1; if quantity is 1, Remove Goal. The overlay does not keep a 0.
|
||||
|
||||
No confirm on Clear.
|
||||
|
||||
---
|
||||
|
||||
## First wiring
|
||||
|
||||
The three capture hosts are the experience target. The first adapter that can call `CreateGoal(ItemId)` is enough to prove the use case. Overlay on the **right** of the play screen.
|
||||
|
||||
Do not start EMI. Do not start a planner menu.
|
||||
|
||||
---
|
||||
|
||||
## Related Documents
|
||||
|
||||
[[🎯 Goal]]
|
||||
|
||||
[[📦 Packages]]
|
||||
|
||||
[[🔌 Recipe Provider]]
|
||||
|
||||
[[📈 Progress Calculation]]
|
||||
|
||||
[[🖥️ Experience]]
|
||||
|
||||
[[🖼️ Wireframes]]
|
||||
|
||||
[[📝 Decisions]]
|
||||
|
||||
[[🏛️ Architecture]]
|
||||
@@ -0,0 +1,232 @@
|
||||
# 🏛️ Architecture
|
||||
|
||||
This is a living scaffold. It will change as we iterate.
|
||||
|
||||
Language lives in [[🗣️ Ubiquitous Language]]. This document describes how that domain is structured in code.
|
||||
|
||||
Satistaskory is designed with Domain-Driven Design.
|
||||
|
||||
---
|
||||
|
||||
## 📜 Golden Rule
|
||||
|
||||
The Domain Layer must not know about EMI, JEI, REI, NeoForge APIs, UI frameworks, or save formats.
|
||||
|
||||
Infrastructure serves the domain. Never the other way around.
|
||||
|
||||
Goals are the domain. Recipes are implementation details.
|
||||
|
||||
---
|
||||
|
||||
## Core domain chain
|
||||
|
||||
```text
|
||||
Goal
|
||||
↓
|
||||
Recipe Resolution
|
||||
↓
|
||||
Material Requirements
|
||||
↓
|
||||
Material Aggregation
|
||||
↓
|
||||
Inventory State (available quantities)
|
||||
↓
|
||||
Missing Materials / Ready To Craft
|
||||
↓
|
||||
Completed Goal
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Layers
|
||||
|
||||
Dependencies point inward. The domain does not depend on infrastructure.
|
||||
|
||||
```text
|
||||
+--------------------------+
|
||||
| UI Layer |
|
||||
+--------------------------+
|
||||
|
|
||||
v
|
||||
+--------------------------+
|
||||
| Application Layer |
|
||||
+--------------------------+
|
||||
|
|
||||
v
|
||||
+--------------------------+
|
||||
| Domain Layer | <-----+
|
||||
+--------------------------+ |
|
||||
|
|
||||
+--------------------------+
|
||||
| Infrastructure Layer |
|
||||
+--------------------------+
|
||||
```
|
||||
|
||||
The UI and application layers call the domain.
|
||||
|
||||
Infrastructure implements interfaces defined by the domain (and used by the application). It is not below the domain in a dependency sense; it sits outside and plugs in.
|
||||
|
||||
---
|
||||
|
||||
## Domain
|
||||
|
||||
This layer contains the actual business logic.
|
||||
|
||||
Primary objects:
|
||||
|
||||
- `Goal` — [[🎯 Goal]]
|
||||
- `MaterialRequirement` — [[🧱 Material Requirement]]
|
||||
- `ProgressState` — [[📉 Missing Material]], [[🛠️ Ready To Craft]]
|
||||
|
||||
`Project` and [[✅ Completed Goal]] exist in the language. They are not packaged in the first slice. See [[📦 Packages]].
|
||||
|
||||
`InventoryState` is a value the domain consumes (available quantities). How that snapshot is collected is infrastructure. See [[🎒 Inventory State]].
|
||||
|
||||
Domain services:
|
||||
|
||||
- [[🧾 Recipe Resolution]] — goal → material requirements
|
||||
- [[➕ Material Aggregation]] — active goals → aggregated list
|
||||
- [[📈 Progress Calculation]] — missing, ready-to-craft, completion
|
||||
|
||||
Recipe resolution uses a `RecipeProvider` port. It does not call a recipe mod.
|
||||
|
||||
---
|
||||
|
||||
## Application
|
||||
|
||||
Coordinates use cases.
|
||||
|
||||
First use case: [[▶️ Create Goal]].
|
||||
|
||||
Same slice: Adjust Goal Quantity, Remove Goal, Clear Goals, Refresh Progress.
|
||||
|
||||
Mark Goal Complete is named. It is not in the first slice.
|
||||
|
||||
The application layer calls infrastructure through ports (`RecipeProvider`, inventory snapshot). It does not contain domain rules. It loads what the use case needs, asks the domain to decide, and presents the result. Persistence is in-memory for this slice.
|
||||
|
||||
Packages: [[📦 Packages]].
|
||||
|
||||
---
|
||||
|
||||
## Infrastructure
|
||||
|
||||
Infrastructure exists to satisfy domain requirements.
|
||||
|
||||
Infrastructure may be replaced.
|
||||
|
||||
Examples:
|
||||
|
||||
- NeoForge
|
||||
- EMI
|
||||
- JEI
|
||||
- REI
|
||||
- Save data storage
|
||||
- Inventory scanning
|
||||
|
||||
Infrastructure is never the source of domain truth.
|
||||
|
||||
---
|
||||
|
||||
## Recipe abstraction
|
||||
|
||||
The domain should never directly depend on a recipe mod.
|
||||
|
||||
Port: [[🔌 Recipe Provider]] — `resolve(ItemId, quantity) → list of MaterialRequirement`.
|
||||
|
||||
First implementation: `StubRecipeProvider`. Later: EMI, JEI, REI, vanilla.
|
||||
|
||||
The rest of the system should not care which provider is active.
|
||||
|
||||
Recipe viewing is out of scope. This port exists so the domain can resolve requirements, not so Satistaskory can become a recipe browser.
|
||||
|
||||
---
|
||||
|
||||
## Persistence abstraction
|
||||
|
||||
The domain should not know where data is stored.
|
||||
|
||||
Possible implementations:
|
||||
|
||||
- World Save
|
||||
- Server Save
|
||||
- Future Cloud Sync
|
||||
|
||||
First slice: in-memory. No save adapter yet.
|
||||
|
||||
---
|
||||
|
||||
## Inventory abstraction
|
||||
|
||||
The domain should not know how inventory is read.
|
||||
|
||||
It receives available quantities (`InventoryState`).
|
||||
|
||||
How those quantities are gathered (player inventory, ender chest, later storage integrations) is infrastructure and may change without a domain rewrite.
|
||||
|
||||
First slice: player inventory only.
|
||||
|
||||
---
|
||||
|
||||
## UI philosophy
|
||||
|
||||
The UI should be replaceable. It renders domain information. It does not contain domain logic.
|
||||
|
||||
Discovered consumers (see [[🖥️ Experience]]):
|
||||
|
||||
- **Capture** — in-place on inventory, crafting bench craft pane, and craft book. Hover → `+ Add to Crafting Goals`. We do not own those views.
|
||||
- **Living** — play overlay panel on the **right** of the play screen (not a pause menu). Two regions: [[🎯 Goal|goals]] with quantity `[+]` / `[-]`, then aggregated materials still needed (one row per material, with a count). `X Clear Items` clears the goal list. See [[🖼️ Wireframes]] Screen 2.
|
||||
|
||||
Not discovered:
|
||||
|
||||
- Full-screen planner
|
||||
- Row selection / per-goal filter of the missing list
|
||||
|
||||
Progressive disclosure is a UI concern guided by the domain: the materials region defaults to missing materials; expand into per-goal breakdowns, recipe trees, and dependency chains only on demand. Those expansions are not this panel’s first drawing.
|
||||
|
||||
---
|
||||
|
||||
## Architectural rules
|
||||
|
||||
1. Goals are the domain.
|
||||
2. Recipes are infrastructure.
|
||||
3. UI is infrastructure.
|
||||
4. Storage is infrastructure.
|
||||
5. Integrations are infrastructure.
|
||||
6. The domain layer must not depend on infrastructure.
|
||||
7. Infrastructure may depend on the domain.
|
||||
|
||||
---
|
||||
|
||||
## Success criteria
|
||||
|
||||
If EMI, JEI, REI, or another recipe mod disappears tomorrow, Satistaskory should require only an adapter replacement and not a domain rewrite.
|
||||
|
||||
The domain model should survive infrastructure changes.
|
||||
|
||||
See [[🎯 Success Metrics]].
|
||||
|
||||
---
|
||||
|
||||
## Related Documents
|
||||
|
||||
[[🧠 Philosophy]]
|
||||
|
||||
[[📦 Bounded Contexts]]
|
||||
|
||||
[[📝 Decisions]]
|
||||
|
||||
[[🗣️ Ubiquitous Language]]
|
||||
|
||||
[[🧾 Recipe Resolution]]
|
||||
|
||||
[[🖥️ Experience]]
|
||||
|
||||
[[🚶 Day in the Life]]
|
||||
|
||||
[[🖼️ Wireframes]]
|
||||
|
||||
[[📦 Packages]]
|
||||
|
||||
[[🔌 Recipe Provider]]
|
||||
|
||||
[[▶️ Create Goal]]
|
||||
@@ -0,0 +1,265 @@
|
||||
# 📝 Architectural Decision Log
|
||||
|
||||
---
|
||||
|
||||
### ADR-001 — Domain first; recipes, UI, storage, and integrations are infrastructure
|
||||
|
||||
**Date:** 2026-09-07
|
||||
|
||||
**Decision:** Goals are the domain. EMI, JEI, REI, NeoForge, UI, and save formats are infrastructure.
|
||||
|
||||
**Reason:**
|
||||
|
||||
Satistaskory exists to remember what the player is building and what is still missing. Centering a recipe mod or a GUI would make the tool the domain.
|
||||
|
||||
**Status:** ✅ Accepted
|
||||
|
||||
---
|
||||
|
||||
### ADR-002 — Layered DDD; domain does not depend on infrastructure
|
||||
|
||||
**Date:** 2026-09-07
|
||||
|
||||
**Decision:** UI and Application depend on Domain. Infrastructure implements domain ports and depends inward.
|
||||
|
||||
**Reason:**
|
||||
|
||||
The domain model must survive infrastructure changes. A downward Domain → Infrastructure dependency would make adapters the source of truth.
|
||||
|
||||
**Status:** ✅ Accepted
|
||||
|
||||
---
|
||||
|
||||
### ADR-003 — RecipeProvider port
|
||||
|
||||
**Date:** 2026-09-07
|
||||
|
||||
**Decision:** Recipe lookup goes through a `RecipeProvider` interface.
|
||||
|
||||
Implementations: EMI, JEI, REI. Future: vanilla.
|
||||
|
||||
The rest of the system does not care which provider is active.
|
||||
|
||||
**Reason:**
|
||||
|
||||
If a recipe mod disappears, only an adapter should change.
|
||||
|
||||
Recipe viewing is out of scope. The port exists for [[🧾 Recipe Resolution]], not for browsing recipes.
|
||||
|
||||
**Status:** ✅ Accepted
|
||||
|
||||
---
|
||||
|
||||
### ADR-004 — Persistence is replaceable
|
||||
|
||||
**Date:** 2026-09-07
|
||||
|
||||
**Decision:** The domain does not know where data is stored.
|
||||
|
||||
Possible implementations: world save, server save, future cloud sync.
|
||||
|
||||
**Status:** ✅ Accepted
|
||||
|
||||
---
|
||||
|
||||
### ADR-005 — Inventory is infrastructure; domain consumes quantities
|
||||
|
||||
**Date:** 2026-09-07
|
||||
|
||||
**Decision:** [[🎒 Inventory State]] is available quantities. Scanning inventories is infrastructure.
|
||||
|
||||
**Reason:**
|
||||
|
||||
Player inventory, ender chest, and later storage integrations are collection strategies. The domain formula is `Missing = Required - Available`.
|
||||
|
||||
**Status:** ✅ Accepted
|
||||
|
||||
---
|
||||
|
||||
### ADR-006 — UI is replaceable infrastructure
|
||||
|
||||
**Date:** 2026-09-07
|
||||
|
||||
**Decision:** Sidebar, full-screen planner, HUD, and future integrations are consumers of domain information. They do not contain domain logic.
|
||||
|
||||
**Reason:**
|
||||
|
||||
Progressive disclosure is a UI concern guided by the domain. Default: missing materials.
|
||||
|
||||
**Status:** ✅ Accepted
|
||||
|
||||
---
|
||||
|
||||
### ADR-007 — Three domain services, not one recipe-aggregation blob
|
||||
|
||||
**Date:** 2026-09-07
|
||||
|
||||
**Decision:** Domain services are [[🧾 Recipe Resolution]], [[➕ Material Aggregation]], and [[📈 Progress Calculation]].
|
||||
|
||||
**Reason:**
|
||||
|
||||
Resolution converts one goal into requirements. Aggregation combines active goals. Progress compares requirements to inventory. Those are different questions.
|
||||
|
||||
**Status:** ✅ Accepted
|
||||
|
||||
---
|
||||
|
||||
### ADR-008 — Ready To Craft is not completion
|
||||
|
||||
**Date:** 2026-09-07
|
||||
|
||||
**Decision:** [[🛠️ Ready To Craft]] means materials are available. [[✅ Completed Goal]] follows a configurable completion strategy (manual, inventory detection, future implementations).
|
||||
|
||||
**Reason:**
|
||||
|
||||
Having the diamonds is not the same as considering the work finished.
|
||||
|
||||
**Status:** ✅ Accepted
|
||||
|
||||
---
|
||||
|
||||
### ADR-009 — Projects are organizational only
|
||||
|
||||
**Date:** 2026-09-07
|
||||
|
||||
**Decision:** [[📁 Project]] groups [[🎯 Goal|goals]] for the player. Material calculations aggregate across projects, from active goals.
|
||||
|
||||
**Status:** ✅ Accepted
|
||||
|
||||
---
|
||||
|
||||
### ADR-010 — Play overlay is the living surface; capture is in-place
|
||||
|
||||
**Date:** 2026-09-07
|
||||
|
||||
**Decision:** The daily consumer is a play overlay (HUD / sidebar family) showing [[📉 Missing Material|missing materials]] while the player walks.
|
||||
|
||||
A [[🎯 Goal]] is named in place: hover an item in inventory, the crafting bench craft pane, or the craft book, then `+ Add to Crafting Goals`.
|
||||
|
||||
Satistaskory does not own those host views. It does not use a pause menu or planner pane as the daily desk.
|
||||
|
||||
**Reason:**
|
||||
|
||||
The product is a cognitive prosthetic during play. A dedicated menu would make the tool the desk. Capture should happen where the player already noticed the item.
|
||||
|
||||
Player copy "Crafting Goals" means [[🎯 Goal]]. Code and docs say Goal.
|
||||
|
||||
**Status:** ✅ Accepted
|
||||
|
||||
---
|
||||
|
||||
### ADR-011 — Play overlay has two regions: Goals and Missing Materials
|
||||
|
||||
**Date:** 2026-09-07
|
||||
|
||||
**Decision:** The living overlay (player concept art, [[🖼️ Wireframes]] Screen 2) has two regions:
|
||||
|
||||
1. Active [[🎯 Goal|goals]] with Target Quantity, adjusted by `[+]` / `[-]`
|
||||
2. Aggregated materials still needed — one row per material, with a count (`Missing = Required - Available`)
|
||||
|
||||
The concept art’s lower region was unfinished (a material name, no counts). The finished drawing is [[➕ Material Aggregation]] plus [[📈 Progress Calculation]], not a recipe tree.
|
||||
|
||||
`X Clear Items` is on this overlay.
|
||||
|
||||
The overlay remains on the play screen. It is not a pause menu. No row selection is drawn: aggregation stays across active goals. Same material from two goals is one row.
|
||||
|
||||
Initial quantity at capture is not decided.
|
||||
|
||||
**Reason:**
|
||||
|
||||
The vision asks two questions. The concept art is the chrome. Philosophy Rule #3 still forbids recipe breakdowns as the first drawing of the materials region.
|
||||
|
||||
**Status:** ✅ Accepted
|
||||
|
||||
**Refines:** ADR-010 (the overlay is not missing-materials-only)
|
||||
|
||||
---
|
||||
|
||||
### ADR-012 — Goal identity and quantity
|
||||
|
||||
**Date:** 2026-09-08
|
||||
|
||||
**Decision:**
|
||||
|
||||
- One [[🎯 Goal]] per Target Item (`ItemId`) in the plan
|
||||
- Target Quantity ≥ 1 always
|
||||
- [[▶️ Create Goal]] uses quantity **1** (new) or **+1** (already present)
|
||||
- `[-]` at quantity 1 **removes** the goal
|
||||
- `ItemId` is `namespace:path`, not a Minecraft `Item` class
|
||||
|
||||
**Reason:**
|
||||
|
||||
Hover-add has no picker. Two rows for the same furnace would split aggregation for no gain. Quantity 0 is not a goal.
|
||||
|
||||
**Status:** ✅ Accepted
|
||||
|
||||
**Settles:** the open quantity questions left by ADR-011
|
||||
|
||||
---
|
||||
|
||||
### ADR-013 — First slice freezes
|
||||
|
||||
**Date:** 2026-09-08
|
||||
|
||||
**Decision:** The first code slice is Create Goal → stub recipes → player inventory → play overlay. Frozen for that slice only:
|
||||
|
||||
| Topic | Freeze |
|
||||
|-------|--------|
|
||||
| Persistence | In-memory. ADR-004 still holds |
|
||||
| Inventory | Player inventory only |
|
||||
| Recipes | `StubRecipeProvider`. Not EMI/JEI/REI |
|
||||
| Overlay placement | Right side of the play screen |
|
||||
| Clear | No confirm |
|
||||
| Projects | Not packaged |
|
||||
| Completion | Not in the slice |
|
||||
| Capture hosts | Experience still names three; first wiring may be one caller of Create Goal |
|
||||
|
||||
**Reason:**
|
||||
|
||||
A prototype that starts with EMI or a save format is an adapter project. This slice proves the domain chain.
|
||||
|
||||
**Status:** ✅ Accepted
|
||||
|
||||
---
|
||||
|
||||
### ADR-014 — RecipeProvider shape; stub first
|
||||
|
||||
**Date:** 2026-09-08
|
||||
|
||||
**Decision:** See [[🔌 Recipe Provider]].
|
||||
|
||||
`resolve(ItemId, quantity) → list of MaterialRequirement`
|
||||
|
||||
One crafting level. No recipe → `(target, quantity)` (gather). `quantity < 1` → empty. Provider picks one recipe and returns concrete items.
|
||||
|
||||
First impl: `StubRecipeProvider`. Production EMI/JEI/REI adapters come after the port is proven.
|
||||
|
||||
**Status:** ✅ Accepted
|
||||
|
||||
**Refines:** ADR-003 (named the port; this is the shape and the first impl)
|
||||
|
||||
---
|
||||
|
||||
## Related Documents
|
||||
|
||||
[[🏛️ Architecture]]
|
||||
|
||||
[[🌟 Project Vision]]
|
||||
|
||||
[[🧠 Philosophy]]
|
||||
|
||||
[[🎯 Goal]]
|
||||
|
||||
[[🖥️ Experience]]
|
||||
|
||||
[[🚶 Day in the Life]]
|
||||
|
||||
[[🖼️ Wireframes]]
|
||||
|
||||
[[▶️ Create Goal]]
|
||||
|
||||
[[🔌 Recipe Provider]]
|
||||
|
||||
[[📦 Packages]]
|
||||
|
||||
[[➕ Material Aggregation]]
|
||||
@@ -0,0 +1,73 @@
|
||||
# 📦 Packages
|
||||
|
||||
Java packages for the first slice. Root: `com.sufficient.satistaskory`.
|
||||
|
||||
Rule #9: do not add a package until the slice needs it. No `project`, `emi`, or `persistence` until those are in the slice.
|
||||
|
||||
---
|
||||
|
||||
## Layout
|
||||
|
||||
```text
|
||||
com.sufficient.satistaskory
|
||||
Satistaskory.java # NeoForge entry. Wiring only. Not the domain.
|
||||
|
||||
domain/
|
||||
ItemId
|
||||
Goal
|
||||
MaterialRequirement
|
||||
InventoryState
|
||||
MissingMaterial
|
||||
RecipeProvider # port (interface)
|
||||
RecipeResolution # domain service
|
||||
MaterialAggregation # domain service
|
||||
ProgressCalculation # domain service
|
||||
|
||||
application/
|
||||
CreateGoal
|
||||
AdjustGoalQuantity
|
||||
RemoveGoal
|
||||
ClearGoals
|
||||
RefreshProgress
|
||||
|
||||
infrastructure/
|
||||
recipe/
|
||||
StubRecipeProvider # first impl. Not EMI/JEI/REI.
|
||||
inventory/
|
||||
PlayerInventoryAdapter # player inventory → InventoryState
|
||||
client/
|
||||
PlayOverlay # Screen 2
|
||||
CaptureHook # Screen 1 — one host is enough to start
|
||||
```
|
||||
|
||||
Dependencies point inward: `infrastructure` and `application` may import `domain`. `domain` imports nothing from NeoForge, EMI, JEI, REI, or `infrastructure`.
|
||||
|
||||
---
|
||||
|
||||
## What is not packaged yet
|
||||
|
||||
| Omitted | Why |
|
||||
|---------|-----|
|
||||
| `Project` | Organizational only; not in the slice |
|
||||
| Completion strategy | Ready ≠ complete; complete is not in the slice |
|
||||
| `EmiRecipeProvider` / JEI / REI | Adapters after the stub proves the port |
|
||||
| Persistence | In-memory goals. ADR-004 still holds; no save adapter yet |
|
||||
| Full-screen planner | Not discovered |
|
||||
|
||||
The example block/item in the NeoForge template is not a package. Remove it when domain types land; do not put Goal next to it as if they were peers.
|
||||
|
||||
---
|
||||
|
||||
## Related Documents
|
||||
|
||||
[[🏛️ Architecture]]
|
||||
|
||||
[[▶️ Create Goal]]
|
||||
|
||||
[[🔌 Recipe Provider]]
|
||||
|
||||
[[🎯 Goal]]
|
||||
|
||||
[[📝 Decisions]]
|
||||
|
||||
[[🧠 Philosophy]]
|
||||
@@ -0,0 +1,79 @@
|
||||
# 🔌 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]]
|
||||
Reference in New Issue
Block a user