Skip to content

🛡️ Crafting — Local Bench Authority

This file contains a default local implementation of ICraftingBenchAuthority used by Unity-facing workbenches to decide whether a craft should be enqueued.

LocalBenchAuthority is a simple, opt-in helper for single-player or local testing setups.


🎯 Purpose

LocalBenchAuthority provides a minimal authority check for workbenches:

  • Always allows enqueue attempts
  • Requires no external systems
  • Useful for:

  • single-player projects

  • demos and prototypes
  • testing crafting behaviour without authority constraints

It exists to avoid forcing projects to implement authority logic when it is not needed.


⚙️ Behaviour

public bool CanEnqueueFromBench(GameObject owner) => true;
  • Always returns true
  • Ignores the owner parameter
  • Does not perform validation, networking checks, or permissions

🔗 How it is used

Workbench components use this interface as part of their enqueue gating:

  1. If a ICraftingBenchAuthority is assigned → it is used
  2. Otherwise, workbenches may fall back to:

  3. CraftingService.HasAuthorityGate + CanMutate(...)

  4. If serverOnly = true and no authority is available → enqueue is denied

LocalBenchAuthority satisfies step (1) with a permissive implementation.


🌐 Multiplayer / Server-authoritative projects

LocalBenchAuthority is not suitable for multiplayer authority control.

For networked projects:

  • Implement your own ICraftingBenchAuthority
  • Return true only on the server/host
  • Block enqueue attempts on clients

Example use cases:

  • NGO / Mirror / Fusion authority checks
  • server RPC gating
  • ownership validation

🧠 Relationship to CraftingService

  • LocalBenchAuthority is not used by CraftingService directly
  • It only affects bench/workbench behaviour before enqueue
  • CraftingService enforces its own authority via ICraftingAuthority (if present)

This separation keeps:

  • bench interaction logic simple
  • core crafting logic authoritative and independent

💡 Notes

  • Completely optional — safe to remove
  • Exists purely as a convenience helper
  • Does not affect crafting rules, only whether enqueue is attempted

Summary: LocalBenchAuthority is a permissive, single-player-friendly authority helper for workbenches. Replace it in multiplayer scenarios with a proper authority-aware implementation.