类 HolderSet.Named<T>

java.lang.Object
net.minecraft.core.HolderSet.ListBacked<T>
net.minecraft.core.HolderSet.Named<T>
所有已实现的接口:
Iterable<Holder<T>>, HolderSet<T>, IHolderSetExtension<T>
封闭接口:
HolderSet<T>

public static class HolderSet.Named<T> extends HolderSet.ListBacked<T>
  • 字段详细资料

  • 构造器详细资料

  • 方法详细资料

    • bind

      void bind(List<Holder<T>> p_205836_)
    • key

      public TagKey<T> key()
    • contents

      protected List<Holder<T>> contents()
      指定者:
      contents 在类中 HolderSet.ListBacked<T>
    • isBound

      public boolean isBound()
    • unwrap

      public com.mojang.datafixers.util.Either<TagKey<T>,List<Holder<T>>> unwrap()
    • unwrapKey

      public Optional<TagKey<T>> unwrapKey()
    • contains

      public boolean contains(Holder<T> p_205834_)
    • toString

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

      public boolean canSerializeIn(HolderOwner<T> p_256542_)
      指定者:
      canSerializeIn 在接口中 HolderSet<T>
      覆盖:
      canSerializeIn 在类中 HolderSet.ListBacked<T>
    • addInvalidationListener

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

      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.

      参数:
      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.