Class NotHolderSet<T>
java.lang.Object
net.minecraftforge.registries.holdersets.NotHolderSet<T>
- All Implemented Interfaces:
- Iterable<Holder<T>>,- HolderSet<T>,- IForgeHolderSet<T>,- ICustomHolderSet<T>
Holderset that represents all elements of a registry not present in another holderset. forge:exclusion is preferable when the number of allowed elements is small relative to the size of the registry. Json format:
 {
   "type": "forge:not",
   "value": "not_this_holderset" // string, list, or object
 }
 - 
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 SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionNotHolderSet(HolderLookup.RegistryLookup<T> registryLookup, HolderSet<T> value) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddInvalidationListener(Runnable runnable) Adds a callback to run when this holderset's contents invalidate (i.e. because tags were rebound).booleancanSerializeIn(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) booleanget(int i) getList()getRandomElement(RandomSource random) private voiditerator()intsize()stream()toString()type()Returns HolderSetType registered toForgeRegistries.HOLDER_SET_TYPES.unwrap()value()Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraftforge.registries.holdersets.ICustomHolderSetserializationTypeMethods inherited from interface java.lang.IterableforEach, spliterator
- 
Field Details- 
owners
- 
registryLookup
- 
value
- 
list
 
- 
- 
Constructor Details- 
NotHolderSet
 
- 
- 
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) 
- 
registryLookup
- 
value
- 
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
 
- 
addInvalidationListenerDescription copied from interface:IForgeHolderSetAdds 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. - Specified by:
- addInvalidationListenerin interface- IForgeHolderSet<T>
- 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.
 
- 
iterator
- 
stream
- 
sizepublic int size()
- 
unwrap
- 
getRandomElement- Specified by:
- getRandomElementin interface- HolderSet<T>
 
- 
get
- 
contains
- 
canSerializeIn- Specified by:
- canSerializeInin interface- HolderSet<T>
 
- 
unwrapKey
- 
toString
- 
getList
- 
invalidateprivate void invalidate()
 
-