Interface DynamicRegistryView
A view providing access to the registries that are currently being loaded. This is passed to
the
DynamicRegistrySetupCallback
event.-
Method Summary
Modifier and TypeMethodDescriptiongetOptional
(RegistryKey<? extends Registry<? extends T>> registryRef) Returns the registry identified by the registry key.<T> void
registerEntryAdded
(RegistryKey<? extends Registry<? extends T>> registryRef, RegistryEntryAddedCallback<T> callback) A shortcut to registerRegistryEntryAddedCallback
.<T> void
registerEntryRemoved
(RegistryKey<? extends Registry<? extends T>> registryRef, RegistryEntryRemovedCallback<T> callback) A shortcut to registerRegistryEntryRemovedCallback
.stream()
-
Method Details
-
asDynamicRegistryManager
DynamicRegistryManager asDynamicRegistryManager()- Returns:
- an
DynamicRegistryManager
instance representing the registry view
-
stream
- Returns:
- the stream of registries that are currently being loaded
-
getOptional
Returns the registry identified by the registry key. This returns an empty optional if the key does not refer to a registry, or if the current combined registry layer being loaded does not contain the registry.- Parameters:
registryRef
- the registry key of the registry to get- Returns:
- the registry, or
Optional.empty()
if the registry is not currently being loaded
-
registerEntryAdded
<T> void registerEntryAdded(RegistryKey<? extends Registry<? extends T>> registryRef, RegistryEntryAddedCallback<T> callback) A shortcut to registerRegistryEntryAddedCallback
.- Parameters:
registryRef
- the registry key of the registry to register the event tocallback
- the callback of the event
-
registerEntryRemoved
<T> void registerEntryRemoved(RegistryKey<? extends Registry<? extends T>> registryRef, RegistryEntryRemovedCallback<T> callback) A shortcut to registerRegistryEntryRemovedCallback
.- Parameters:
registryRef
- the registry key of the registry to register the event tocallback
- the callback of the event
-