Shared backbone for custom item mods. Register an ItemType and a use-handler; it owns the Harmony plumbing for inventory injection, localized names, hotkey labels, tooltips, and pool-spawn injection. Required by dependent mods.
IItemHandler / ItemHandlerBase for the consumer to implement gameplay callbacks
(OnUse, optional OnEquip / OnUnequip).
Framework-owned Harmony patches:
ItemCollection.Initialize / OnEnable extend the private items[] array
idempotently so vanilla Count / GetItemAtIndex / TryGetItemData see custom items
natively, with no per-mod prefix coordination.
PlayerInventory.TryUseItem dispatches to the registered handler.
PlayerInventory.GetEffectivelyEquippedItem(false) masks custom items to None so
vanilla swing/aim eligibility doesn't get confused by an unknown ItemType.
LocalizedString.GetLocalizedString rewrites ITEM_<rawId> keys to the registered
display name.
PauseMenu.UpdateItemProbabilites appends the optional tooltip text alongside the
vanilla per-pool weight rows.
ItemSpawnerSettings.ResetRuntimeData injects custom items into the requested pools'
spawnChances arrays and recalculates the totals.
Icon tinting goes through a CPU-pixel path on readable source textures and falls back to
a Graphics.Blit through a temporary RenderTexture for unreadable ones, with results
cached by (textureInstanceId, packedRgba).
Localization-table seeding runs once a frame from a hidden host until the Data table
finishes loading, so vanilla code that bypasses the LocalizedString postfix still
resolves the same display names.
Thunderstore development is made possible with ads. Please consider making an exception to your adblock.