Interface Holder<T>

All Known Implementing Classes:
Holder.CustomHolder, Holder.IdHolder

public interface Holder<T>
Represents an object that could either be a network ID, or a custom-defined one.
  • Method Details

    • ofId

      static <T> Holder<T> ofId(int id)
    • ofCustom

      static <T> Holder<T> ofCustom(T object)
    • isId

      boolean isId()
    • id

      int id()
    • isCustom

      boolean isCustom()
    • custom

      T custom()
    • ifId

      Holder<T> ifId(IntConsumer action)
    • ifCustom

      Holder<T> ifCustom(Consumer<T> action)
    • getOrCompute

      T getOrCompute(IntFunction<T> supplier)
      Returns the holder as an object, or else looks up the item in the registry.