Skip to content

🧩 Crafting — Extensibility Abstractions

This folder defines extensibility seams for the Crafting system.

These interfaces allow external code to: - influence crafting behaviour - validate or modify proposed crafts - route crafted outputs

All extensibility here is opt-in and non-invasive. Crafting remains functional without any implementations present.


🎛️ Craft modifiers

ICraftingModifier

Allows external systems to adjust crafting behaviour by mutating a CraftAdjustments value during craft evaluation.

Typical uses include: - modifying craft duration - adjusting output quantities - applying bonuses, penalties, or contextual modifiers

This interface defines only the adjustment hook. Discovery, ordering, and invocation frequency are determined by the Crafting service.


✅ Craft validators

ICraftingValidator

Allows custom validation and/or modification of a proposed craft result before a craft is accepted.

Validators receive: - the current CraftContext - a proposed CraftCheck result

They may return: - the original result unchanged - a modified result (for example, to inject a failure reason or constraint)

This interface does not enforce validation order or exclusivity. Multiple validators may be applied.


📦 Output routing

ICraftingOutputRouter

Provides a routing decision hook for crafted outputs.

Used to: - select a destination container for a crafted item - override default output routing behaviour

Routers are consulted per output add. Returning false indicates no routing decision was made, allowing fallbacks.

The Crafting service determines routing order and fallback behaviour.


Notes

  • These interfaces do not define discovery mechanisms.
  • They do not enforce execution order or call frequency.
  • They do not guarantee determinism unless enforced by the caller.

They exist purely as supported extension points for integrating custom logic into the Crafting pipeline.