ITEMS

Registry for Katton items.

Supports both global registration (during mod initialization) and hot-reloadable registration (after the server has started). Items registered through this registry are tracked by their script owner and can be cleared during reload operations.

The registry handles the complexity of registering items after Minecraft's item registry is frozen by:

  1. Temporarily unfreezing the registry

  2. Injecting intrusive holders if needed

  3. Registering the item

  4. Restoring the registry state

Properties

Link copied to clipboard
Link copied to clipboard
open override val id: Identifier

The identifier for this registry instance

Link copied to clipboard
open override val keys: MutableSet<Identifier>
Link copied to clipboard
open override val size: Int
Link copied to clipboard

Functions

Link copied to clipboard

Clears all managed entries. Called at the start of a reload.

Link copied to clipboard
open override fun clear()
Link copied to clipboard
open override fun containsKey(key: Identifier): Boolean
Link copied to clipboard
Link copied to clipboard
open operator override fun get(key: Identifier): KattonRegistry.KattonItemEntry?
Link copied to clipboard

Initializes this registry. Override to perform initialization logic.

Link copied to clipboard
open override fun isEmpty(): Boolean
Link copied to clipboard
fun newNative(components: KattonItemProperties, registerMode: RegisterMode = RegisterMode.AUTO, itemFactory: (KattonItemProperties) -> Item): KattonRegistry.KattonItemEntry

Registers a native Item instance with hot-reload support.

Link copied to clipboard
open override fun put(key: Identifier, value: KattonRegistry.KattonItemEntry): KattonRegistry.KattonItemEntry?
Link copied to clipboard
open override fun putAll(from: Map<out Identifier, KattonRegistry.KattonItemEntry>)