Interface Registrar<T>
- All Superinterfaces:
Iterable<T>
-
Method Summary
Modifier and TypeMethodDescriptionbyRawId
(int rawId) boolean
contains
(net.minecraft.resources.ResourceLocation id) boolean
containsValue
(T obj) delegate
(net.minecraft.resources.ResourceLocation id) entrySet()
get
(net.minecraft.resources.ResourceLocation id) @Nullable net.minecraft.resources.ResourceLocation
Set<net.minecraft.resources.ResourceLocation>
getIds()
int
net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>>
key()
default <R extends T>
voidlisten
(RegistrySupplier<R> supplier, Consumer<R> callback) Listens to when the registry entry is registered, and calls the given action.void
Listens to when the registry entry is registered, and calls the given action.<E extends T>
RegistrySupplier<E>default <R extends T>
RegistrySupplier<R>wrap
(R obj) Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
delegate
-
wrap
-
register
<E extends T> RegistrySupplier<E> register(net.minecraft.resources.ResourceLocation id, Supplier<E> supplier) -
getId
-
getRawId
-
getKey
-
get
-
byRawId
-
contains
boolean contains(net.minecraft.resources.ResourceLocation id) -
containsValue
-
getIds
Set<net.minecraft.resources.ResourceLocation> getIds() -
entrySet
-
key
net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> key() -
listen
Listens to when the registry entry is registered, and calls the given action. Evaluates immediately if the entry is already registered.Whenever the callback is called is dependent on the registry implementation. On fabric, this will be called when the registry entry is registered. On forge, this will be called when the registry entry is registered or when Minecraft has started.
- Parameters:
supplier
- the entry to listen tocallback
- the action to call when the registry entry is registered
-
listen
Listens to when the registry entry is registered, and calls the given action. Evaluates immediately if the entry is already registered.Whenever the callback is called is dependent on the registry implementation. On fabric, this will be called when the registry entry is registered. On forge, this will be called when the registry entry is registered or when Minecraft has started.
- Parameters:
id
- the entry to listen tocallback
- the action to call when the registry entry is registered
-