Package io.papermc.paper.registry
Interface RegistryAccess
Used for accessing different
Registry
instances
by a RegistryKey
. Get the main instance of RegistryAccess
with registryAccess()
.-
Method Summary
Modifier and TypeMethodDescriptiongetRegistry
(@NotNull RegistryKey<T> registryKey) Gets the registry with the specified key.getRegistry
(@NotNull Class<T> type) Deprecated, for removal: This API element is subject to removal in a future version.static @NotNull RegistryAccess
Get theRegistryAccess
instance for the server.
-
Method Details
-
registryAccess
Get theRegistryAccess
instance for the server.- Returns:
- the RegistryAccess instance
-
getRegistry
@Deprecated(since="1.20.6", forRemoval=true) @Nullable <T extends Keyed> @Nullable Registry<T> getRegistry(@NotNull @NotNull Class<T> type) Deprecated, for removal: This API element is subject to removal in a future version.usegetRegistry(RegistryKey)
with keys fromRegistryKey
Gets the registry based on the type.- Type Parameters:
T
- the type- Parameters:
type
- the type- Returns:
- the registry or null if none found
-
getRegistry
@NotNull <T extends Keyed> @NotNull Registry<T> getRegistry(@NotNull @NotNull RegistryKey<T> registryKey) Gets the registry with the specified key.- Type Parameters:
T
- the type- Parameters:
registryKey
- the key- Returns:
- the registry
- Throws:
NoSuchElementException
- if no registry with the key is foundIllegalArgumentException
- if the registry is not available yet
-
getRegistry(RegistryKey)
with keys fromRegistryKey