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>
Enclosing interface:
HolderSet<T>

public static class HolderSet.Named<T> extends HolderSet.ListBacked<T>
  • Field Details

    • owner

      private final HolderOwner<T> owner
    • key

      private final TagKey<T> key
    • contents

      private @Nullable List<Holder<T>> contents
    • invalidationCallbacks

      private final List<Runnable> invalidationCallbacks
      Neo: holds invalidation callbacks to be run when tags rebind
  • Constructor Details

  • Method Details

    • bind

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

      public TagKey<T> key()
    • contents

      public List<Holder<T>> contents()
      Specified by:
      contents in class 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> value)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • canSerializeIn

      public boolean canSerializeIn(HolderOwner<T> context)
      Specified by:
      canSerializeIn in interface HolderSet<T>
      Overrides:
      canSerializeIn in class HolderSet.ListBacked<T>
    • addInvalidationListener

      public void addInvalidationListener(Runnable runnable)
      Neo: add an invalidation listener to be notified when the bound tag contents change
      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.
    • isImmediatelyResolvable

      public boolean isImmediatelyResolvable()
      Neo: Returns whether this holderset can be immediately resolved to the contents it contains.
      Returns:
      whether this holderset can be immediately resolved to the contents it contains