Package net.minecraft.core
Class HolderSet.Named<T>
java.lang.Object
net.minecraft.core.HolderSet.ListBacked<T>
net.minecraft.core.HolderSet.Named<T>
- All Implemented Interfaces:
- Iterable<Holder<T>>,- HolderSet<T>,- IHolderSetExtension<T>
- 
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.neoforged.neoforge.common.extensions.IHolderSetExtensionIHolderSetExtension.SerializationType
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddInvalidationListener(Runnable runnable) Adds a callback to run when this holderset's contents invalidate (i.e.voidbooleancanSerializeIn(HolderOwner<T> p_256542_) booleancontents()key()toString()unwrap()Methods inherited from class net.minecraft.core.HolderSet.ListBackedget, getRandomElement, iterator, size, spliterator, streamMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.neoforged.neoforge.common.extensions.IHolderSetExtensionserializationType
- 
Field Details- 
owner
- 
key
- 
contents
- 
invalidationCallbacks
 
- 
- 
Constructor Details- 
NamedNamed(HolderOwner<T> p_256118_, TagKey<T> p_256597_) 
 
- 
- 
Method Details- 
bind
- 
key
- 
contents- Specified by:
- contentsin class- HolderSet.ListBacked<T>
 
- 
unwrap
- 
unwrapKey
- 
contains
- 
toString
- 
canSerializeIn- Specified by:
- canSerializeInin interface- HolderSet<T>
- Overrides:
- canSerializeInin class- HolderSet.ListBacked<T>
 
- 
addInvalidationListenerDescription copied from interface:IHolderSetExtensionAdds a callback to run when this holderset's contents invalidate (i.e. because tags were rebound). The intended usage and use case is with composite holdersets that need to cache sets/list based on other holdersets, which may be mutable (because they are tag-based or themselves composite holdersets). Composite holdersets should use this to add callbacks to each of their component holdersets when constructed. - Parameters:
- runnable- Runnable to invoke when this component holderset's contents are no longer valid. This runnable should only clear caches and allow them to be lazily reevaluated later, as not all tag holdersets may have been rebound when this is called. This runnable should also invalidate all of the caller's listeners.
 
 
-