Record Class AnyHolderSet<T>
java.lang.Object
java.lang.Record
net.neoforged.neoforge.registries.holdersets.AnyHolderSet<T>
- All Implemented Interfaces:
Iterable<Holder<T>>, HolderSet<T>, IHolderSetExtension<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": "neoforge:any"
}
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface HolderSet
HolderSet.Direct<T>, HolderSet.ListBacked<T>, HolderSet.Named<T>Nested classes/interfaces inherited from interface IHolderSetExtension
IHolderSetExtension.SerializationType -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final HolderLookup.RegistryLookup<T> The field for theregistryLookuprecord component. -
Constructor Summary
ConstructorsConstructorDescriptionAnyHolderSet(HolderLookup.RegistryLookup<T> registryLookup) Creates an instance of aAnyHolderSetrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanSerializeIn(HolderOwner<T> holderOwner) 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.booleanisBound()iterator()Returns the value of theregistryLookuprecord component.intsize()stream()toString()Returns a string representation of this record class.type()Returns HolderSetType registered to.invalid reference
ForgeRegistries.HOLDER_SET_TYPESunwrap()Methods inherited from interface ICustomHolderSet
serializationTypeMethods inherited from interface IHolderSetExtension
addInvalidationListenerMethods inherited from interface Iterable
forEach, spliterator
-
Field Details
-
registryLookup
The field for theregistryLookuprecord component.
-
-
Constructor Details
-
AnyHolderSet
Creates an instance of aAnyHolderSetrecord class.- Parameters:
registryLookup- the value for theregistryLookuprecord component
-
-
Method Details
-
type
Description copied from interface:ICustomHolderSetReturns HolderSetType registered to.invalid reference
ForgeRegistries.HOLDER_SET_TYPES- Specified by:
typein interfaceICustomHolderSet<T>- Returns:
- HolderSetType registered to
invalid reference
ForgeRegistries.HOLDER_SET_TYPES
-
iterator
-
stream
-
size
-
unwrap
-
getRandomElement
- Specified by:
getRandomElementin interfaceHolderSet<T>
-
get
-
contains
-
canSerializeIn
- Specified by:
canSerializeInin interfaceHolderSet<T>
-
unwrapKey
-
isBound
-
toString
-
hashCode
-
equals
Indicates 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). -
registryLookup
Returns the value of theregistryLookuprecord component.- Returns:
- the value of the
registryLookuprecord component
-