DummyHolder

class DummyHolder<T>(key: ResourceKey<T>) : Holder<T>

A dummy implementation of Holder to help with RuntimeResourcePack creation.

Since Minecraft 1.21.5, the armor trim smithing recipe builder takes an additional argument for the actual pattern to apply, but in the form of a Holder, which is only really handed out by registries. We cannot really access the vanilla registries during RRP serialization though, but we also don't actually need to, since only the ResourceKey is actually required for serialization. This type allows us to do precisely that, acting as a Holder without a value behind the key.

Constructors

Link copied to clipboard
constructor(key: ResourceKey<T>)

Functions

Link copied to clipboard
open override fun canSerializeIn(owner: HolderOwner<T>): Boolean
Link copied to clipboard
@Nullable
open fun <T : Any> getData(type: DataMapType<T, T>): @Nullable T?
Link copied to clipboard
open fun getDelegate(): Holder<T>
Link copied to clipboard
Link copied to clipboard
open override fun is(predicate: Predicate<ResourceKey<T>>): Boolean
open override fun is(holder: Holder<T>): Boolean
open override fun is(resourceKey: ResourceKey<T>): Boolean
open override fun is(location: ResourceLocation): Boolean
open override fun is(tagKey: TagKey<T>): Boolean
Link copied to clipboard
open override fun isBound(): Boolean
Link copied to clipboard
open override fun kind(): Holder.Kind
Link copied to clipboard
open override fun tags(): Stream<TagKey<T>>
Link copied to clipboard
open override fun unwrap(): Either<ResourceKey<T>, T>
Link copied to clipboard
open override fun unwrapKey(): Optional<ResourceKey<T>>
Link copied to clipboard
open override fun value(): T?