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.

Type 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(tag: Tag<T>)
fun register(vararg values: T)
Link copied to clipboard
fun stream(): Stream<T>
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun unregister(tag: Tag<T>)
fun unregister(vararg values: T)
fun unregister(vararg keys: NamespacedKey)
Link copied to clipboard