类 NotHolderSet<T>

java.lang.Object
net.minecraftforge.registries.holdersets.NotHolderSet<T>
所有已实现的接口:
Iterable<Holder<T>>, HolderSet<T>, IForgeHolderSet<T>, ICustomHolderSet<T>

public class NotHolderSet<T> extends Object implements 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
 }
 
  • 字段详细资料

  • 构造器详细资料

  • 方法详细资料

    • codec

      public static <T> com.mojang.serialization.MapCodec<? extends ICustomHolderSet<T>> codec(ResourceKey<? extends Registry<T>> registryKey, com.mojang.serialization.Codec<Holder<T>> holderCodec, boolean forceList)
    • registryLookup

      public HolderLookup.RegistryLookup<T> registryLookup()
    • value

      public HolderSet<T> value()
    • type

      public HolderSetType type()
      从接口复制的说明: ICustomHolderSet
      返回 HolderSetType registered to
      引用无效
      ForgeRegistries.HOLDER_SET_TYPES
      指定者:
      type 在接口中 ICustomHolderSet<T>
      返回:
      HolderSetType registered to
      引用无效
      ForgeRegistries.HOLDER_SET_TYPES
    • addInvalidationListener

      public void addInvalidationListener(Runnable runnable)
      从接口复制的说明: IForgeHolderSet

      Adds 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.

      指定者:
      addInvalidationListener 在接口中 IForgeHolderSet<T>
      参数:
      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

      public Iterator<Holder<T>> iterator()
      指定者:
      iterator 在接口中 Iterable<T>
    • stream

      public Stream<Holder<T>> stream()
      指定者:
      stream 在接口中 HolderSet<T>
    • size

      public int size()
      指定者:
      size 在接口中 HolderSet<T>
    • unwrap

      public com.mojang.datafixers.util.Either<TagKey<T>,List<Holder<T>>> unwrap()
      指定者:
      unwrap 在接口中 HolderSet<T>
    • getRandomElement

      public Optional<Holder<T>> getRandomElement(RandomSource random)
      指定者:
      getRandomElement 在接口中 HolderSet<T>
    • get

      public Holder<T> get(int i)
      指定者:
      get 在接口中 HolderSet<T>
    • contains

      public boolean contains(Holder<T> holder)
      指定者:
      contains 在接口中 HolderSet<T>
    • canSerializeIn

      public boolean canSerializeIn(HolderOwner<T> holderOwner)
      指定者:
      canSerializeIn 在接口中 HolderSet<T>
    • unwrapKey

      public Optional<TagKey<T>> unwrapKey()
      指定者:
      unwrapKey 在接口中 HolderSet<T>
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object
    • getList

      private List<Holder<T>> getList()
    • invalidate

      private void invalidate()
    • isBound

      public boolean isBound()
      指定者:
      isBound 在接口中 HolderSet<T>