Registries and overrides

Add, replace or suppress jobs, shops, items and clothing with deterministic reversible layers.

Registration or overlay

OperationUse it whenDisable behavior
Register*The id is new and owned by this addon.The runtime entry is removed.
Override*The id can already exist and you want a replacement definition.The next lower layer or baseline becomes visible.
Suppress*The id must be unavailable while this addon is active.The next lower layer or baseline becomes visible.
1public void OnHostLoaded( LitherarpAddonContext context )
2{
3 context.OverrideJob( new LitherarpJobsConfig.JobConfigEntry
4 {
5 Id = "courier",
6 Name = "Night Courier",
7 Salary = 70,
8 Selectable = true
9 }, priority: 100 );
10
11 context.SuppressShopEntityItem( "restricted_printer", priority: 200 );
12}
13
14public void OnClientLoaded( LitherarpAddonContext context )
15{
16 // Register item layers in every realm that performs item lookup.
17 context.SuppressItem( "legacy_stimulant", priority: 100 );
18}

Deterministic resolution

  • Priority is an integer from -1000 to 1000. Higher values win.
  • One addon can own one layer for a key.
  • A key and priority pair can have only one owner. A conflicting registration is rejected instead of relying on timing.
  • A replacement keeps the baseline list position. A new key is appended using priority, owner id and key order.
  • Removal is by owner id, so one addon's teardown cannot remove another addon's layer.

Registry behavior

RegistryRegistrationOverlay and live-state behavior
JobsRegisterJobOverrideJob and SuppressJob. A player using a suppressed job is migrated to a validated fallback before it disappears.
Entity shop tabs and itemsFour Register*Item methodsReplace or suppress each list by id. The resolved host registry is synced to clients.
Runtime itemsRegisterRuntimeItemReplace or suppress by ItemId. Existing stacks become inert structural tombstones while suppressed and resolve back when the definition returns.
ClothingRegisterClothingReplace or suppress by resource path. The resolved catalog and suppressions are included in the public snapshot.

Realm consistency

Jobs, shops and clothing are registered on the host and flow through public snapshots. Runtime item definitions and item overlay layers are local registries, so shared addons should register the same item view from the host and client lifecycle for every realm that uses item lookup.