DummyHolderSet

class DummyHolderSet<T>(val tag: TagKey<T>) : HolderSet.Named<T>

A dummy implementation of HolderSet to help with RuntimeResourcePack creation.

In some instances, Minecraft's resource builders expect a HolderSet for specifying a collection of e.g. items. When specifying this collection simply by a TagKey, these must usually be obtained from a net.minecraft.core.Registry. But when creating a RuntimeResourcePack, the only information we need is the actual TagKey itself, which will be serialized to a string beforehand anyway. This class is used for exactly that. It allows us to create a HolderSet from a TagKey without a net.minecraft.core.Registry, and it always serializes to just the tag.

Constructors

Link copied to clipboard
constructor(tag: TagKey<T>)

Properties

Link copied to clipboard
val tag: TagKey<T>

Functions

Link copied to clipboard
open override fun canSerializeIn(owner: HolderOwner<T>): Boolean
Link copied to clipboard
open operator override fun contains(entry: Holder<T>): Boolean
Link copied to clipboard
open operator override fun get(index: Int): Holder<T>?
Link copied to clipboard
open override fun getRandomElement(random: RandomSource): Optional<Holder<T>>
Link copied to clipboard
open operator override fun iterator(): MutableIterator<Holder<T>>
Link copied to clipboard
open fun key(): TagKey<T>
Link copied to clipboard
open override fun size(): Int
Link copied to clipboard
open override fun spliterator(): Spliterator<Holder<T>>
Link copied to clipboard
open override fun stream(): Stream<Holder<T>>
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
open override fun unwrap(): Either<TagKey<T>, List<Holder<T>>>
Link copied to clipboard
open override fun unwrapKey(): Optional<TagKey<T>>