🛡️ 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
ownerparameter - Does not perform validation, networking checks, or permissions
🔗 How it is used¶
Workbench components use this interface as part of their enqueue gating:
- If a
ICraftingBenchAuthorityis assigned → it is used -
Otherwise, workbenches may fall back to:
-
CraftingService.HasAuthorityGate+CanMutate(...) - If
serverOnly = trueand 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
trueonly 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¶
LocalBenchAuthorityis not used byCraftingServicedirectly- It only affects bench/workbench behaviour before enqueue
CraftingServiceenforces its own authority viaICraftingAuthority(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.