Skip to content

🧩 Crafting — Extensibility Abstractions

📦 Folder Overview

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, and expose optional capabilities used by crafting rules.

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


🧩 What Lives Here

  • ICraftingLevelSource — optional capability for level-based rules
  • ICraftingModifier — adjustment hook for craft evaluation
  • ICraftingValidator — validation and result shaping
  • ICraftingOutputRouter — output routing decision hook

🎯 Purpose

These abstractions provide supported extension points to:

  • influence crafting behaviour without modifying Core
  • apply validation and contextual rules
  • adjust duration, cost, and outputs
  • route crafted outputs to appropriate destinations

They allow custom logic to be integrated into the Crafting pipeline while keeping the runtime decoupled from concrete implementations.


🧠 Usage Guidance

ICraftingLevelSource (optional)

Exposes a character or account level that crafting rules may query.

Typically used by validators (for example, level gating) to determine whether a craft should be allowed.

If no level source is present on the owner or parent chain, validators that rely on it do not apply.


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 the adjustment hook only. Discovery, ordering, and invocation frequency are determined by the Crafting service.


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.


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.


⚠️ Important Notes

  • These interfaces do not define discovery mechanisms
  • They do not enforce execution order or call frequency
  • Determinism depends on caller-controlled ordering and behaviour

  • Crafting Core (evaluation, validation, and routing flow)
  • Integrations (example implementations and adapters)