Record Class AnyHolderSet<T>
java.lang.Object
java.lang.Record
net.minecraftforge.registries.holdersets.AnyHolderSet<T>
- All Implemented Interfaces:
- Iterable<Holder<T>>,- HolderSet<T>,- IForgeHolderSet<T>,- ICustomHolderSet<T>
public record AnyHolderSet<T>(HolderLookup.RegistryLookup<T> registryLookup)
extends Record
implements ICustomHolderSet<T>
Holderset that represents all elements of a registry. Json format:
 {
   "type": "forge:any"
 }
 - 
Nested Class SummaryNested classes/interfaces inherited from interface net.minecraft.core.HolderSetHolderSet.Direct<T>, HolderSet.ListBacked<T>, HolderSet.Named<T>Nested classes/interfaces inherited from interface net.minecraftforge.common.extensions.IForgeHolderSetIForgeHolderSet.SerializationType
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final HolderLookup.RegistryLookup<T>The field for theregistryLookuprecord component.
- 
Constructor SummaryConstructorsConstructorDescriptionAnyHolderSet(HolderLookup.RegistryLookup<T> registryLookup) Creates an instance of aAnyHolderSetrecord class.
- 
Method SummaryModifier and TypeMethodDescriptionbooleancanSerializeIn(HolderOwner<T> holderOwner) static <T> com.mojang.serialization.Codec<? extends ICustomHolderSet<T>>codec(ResourceKey<? extends Registry<T>> registryKey, com.mojang.serialization.Codec<Holder<T>> holderCodec, boolean forceList) booleanfinal booleanIndicates whether some other object is "equal to" this one.get(int i) getRandomElement(RandomSource random) final inthashCode()Returns a hash code value for this object.iterator()Returns the value of theregistryLookuprecord component.intsize()stream()toString()Returns a string representation of this record class.type()Returns HolderSetType registered toForgeRegistries.HOLDER_SET_TYPES.unwrap()Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraftforge.registries.holdersets.ICustomHolderSetserializationTypeMethods inherited from interface net.minecraftforge.common.extensions.IForgeHolderSetaddInvalidationListenerMethods inherited from interface java.lang.IterableforEach, spliterator
- 
Field Details- 
registryLookupThe field for theregistryLookuprecord component.
 
- 
- 
Constructor Details- 
AnyHolderSetCreates an instance of aAnyHolderSetrecord class.- Parameters:
- registryLookup- the value for the- registryLookuprecord component
 
 
- 
- 
Method Details- 
codecpublic static <T> com.mojang.serialization.Codec<? extends ICustomHolderSet<T>> codec(ResourceKey<? extends Registry<T>> registryKey, com.mojang.serialization.Codec<Holder<T>> holderCodec, boolean forceList) 
- 
typeDescription copied from interface:ICustomHolderSetReturns HolderSetType registered toForgeRegistries.HOLDER_SET_TYPES.- Specified by:
- typein interface- ICustomHolderSet<T>
- Returns:
- HolderSetType registered to ForgeRegistries.HOLDER_SET_TYPES
 
- 
iterator
- 
stream
- 
sizepublic int size()
- 
unwrap
- 
getRandomElement- Specified by:
- getRandomElementin interface- HolderSet<T>
 
- 
get
- 
contains
- 
canSerializeIn- Specified by:
- canSerializeInin interface- HolderSet<T>
 
- 
unwrapKey
- 
toStringReturns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
- 
hashCodepublic final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
- 
equalsIndicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object).
- 
registryLookupReturns the value of theregistryLookuprecord component.- Returns:
- the value of the registryLookuprecord component
 
 
-