Interface RegistrySupplier<T>

All Superinterfaces:
Supplier<T>

@NonExtendable public interface RegistrySupplier<T> extends Supplier<T>
  • Method Details

    • getRegistrarManager

      RegistrarManager getRegistrarManager()
    • getRegistrar

      Registrar<T> getRegistrar()
    • getRegistryId

      net.minecraft.resources.ResourceLocation getRegistryId()
      Returns:
      the identifier of the registry
    • getRegistryKey

      default net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> getRegistryKey()
      Returns:
      the identifier of the registry
    • getId

      net.minecraft.resources.ResourceLocation getId()
      Returns:
      the identifier of the entry
    • isPresent

      boolean isPresent()
      Returns:
      whether the entry has been registered
    • getOrNull

      @Nullable default T getOrNull()
    • toOptional

      default Optional<T> toOptional()
    • ifPresent

      default void ifPresent(Consumer<? super T> action)
    • ifPresentOrElse

      default void ifPresentOrElse(Consumer<? super T> action, Runnable emptyAction)
    • stream

      default Stream<T> stream()
    • orElse

      default T orElse(T other)
    • orElseGet

      default T orElseGet(Supplier<? extends T> supplier)
    • listen

      default void listen(Consumer<T> callback)
      Listens to when the registry entry is registered, and calls the given action. Evaluates immediately if the entry is already registered.
      Parameters:
      callback - the action to call when the registry entry is registered