- All Superinterfaces:
Supplier<T>
@NonExtendable
public interface RegistrySupplier<T>
extends Supplier<T>
-
Method Summary
net.minecraft.resources.ResourceLocation
net.minecraft.resources.ResourceLocation
default net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>>
default void
default void
boolean
default void
Listens to when the registry entry is registered, and calls the given action.
Methods inherited from interface java.util.function.Supplier
get
-
Method Details
-
-
-
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()
-
-
ifPresent
default void ifPresent(Consumer<? super T> action)
-
-
-
orElse
default T orElse(T other)
-
orElseGet
default T orElseGet(Supplier<? extends T> supplier)
-
listen
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