RebarRegistry

Represents a list of things that can be registered and looked up by NamespacedKey. This class is not thread safe and any concurrent access must be synchronized externally.

Parameters

T

the type of the registered values

Constructors

Link copied to clipboard
constructor(key: NamespacedKey)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

the key of this registry

Functions

Link copied to clipboard
operator fun contains(key: NamespacedKey): Boolean
operator fun contains(tag: Tag<T>): Boolean
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
operator fun get(key: NamespacedKey): T?
Link copied to clipboard
Link copied to clipboard
fun getOrCreate(key: NamespacedKey, creator: () -> T): T
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open operator override fun iterator(): Iterator<T>
Link copied to clipboard

Maps a key to another key, allowing values to be looked up by either key. This is useful for updating keys without breaking existing references. For example, if an item is renamed from "addon:old_item" to "addon:new_item", you can map "addon:old_item" to "addon:new_item" so that both keys will return the same item.

Link copied to clipboard
fun register(vararg values: T)
fun register(tag: Tag<T>)
Link copied to clipboard
fun stream(): Stream<T>
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun unregister(vararg values: T): <Error class: unknown class>
fun unregister(vararg keys: NamespacedKey)
fun unregister(tag: Tag<T>): <Error class: unknown class>
Link copied to clipboard