Package io.papermc.paper.registry
Interface Reference<T extends Keyed>
- Type Parameters:
T
- type of the value
- All Superinterfaces:
net.kyori.adventure.key.Keyed
,Keyed
@Deprecated(forRemoval=true,
since="1.20.6")
public interface Reference<T extends Keyed>
extends Keyed
Deprecated, for removal: This API element is subject to removal in a future version.
Represents a reference to a server-backed registry value that may
change.
-
Method Summary
Modifier and TypeMethodDescriptioncreate
(@NotNull Registry<T> registry, @NotNull NamespacedKey key) Deprecated, for removal: This API element is subject to removal in a future version.value()
Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.
-
Method Details
-
value
Deprecated, for removal: This API element is subject to removal in a future version.Gets the value from the registry with the key.- Returns:
- the value
- Throws:
NoSuchElementException
- if there is no value with this key
-
valueOrNull
Deprecated, for removal: This API element is subject to removal in a future version.Gets the value from the registry with the key.- Returns:
- the value or null if it doesn't exist
-
create
@Deprecated(forRemoval=true, since="1.20.6") @NotNull static <T extends Keyed> @NotNull Reference<T> create(@NotNull @NotNull Registry<T> registry, @NotNull @NotNull NamespacedKey key) Deprecated, for removal: This API element is subject to removal in a future version.Creates a reference to a registered value.- Type Parameters:
T
- the type of the value- Parameters:
registry
- the registry the value is located inkey
- the key to the value- Returns:
- a reference
-