Interface IHolderSetExtension<T>

All Known Subinterfaces:
HolderSet<T>, ICustomHolderSet<T>
All Known Implementing Classes:
AndHolderSet, AnyHolderSet, CompositeHolderSet, HolderSet.Direct, HolderSet.ListBacked, HolderSet.Named, NotHolderSet, OrHolderSet

public interface IHolderSetExtension<T>
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
    What format a holderset serializes to in json/nbt/etc
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Adds a callback to run when this holderset's contents invalidate (i.e. because tags were rebound).
    default boolean
    Determines whether this holderset can be immediately resolved to the contents it contains or if it must wait for tags to be loaded.
    What format this holderset serializes to in json/nbt/etc
  • Method Details

    • addInvalidationListener

      default void addInvalidationListener(Runnable runnable)

      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.

      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.
    • serializationType

      default IHolderSetExtension.SerializationType serializationType()
      What format this holderset serializes to in json/nbt/etc
    • isImmediatelyResolvable

      default boolean isImmediatelyResolvable()
      Determines whether this holderset can be immediately resolved to the contents it contains or if it must wait for tags to be loaded.