Interface Reference<T extends Keyed>

Type Parameters:
T - type of the value
All Superinterfaces:
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 Type
    Method
    Description
    static <T extends Keyed>
    @NotNull Reference<T>
    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.
    Deprecated, for removal: This API element is subject to removal in a future version.

    Methods inherited from interface org.bukkit.Keyed

    getKey, key
  • Method Details

    • value

      @Deprecated(forRemoval=true, since="1.20.6") @NotNull T 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(forRemoval=true, since="1.20.6") @Nullable T 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 in
      key - the key to the value
      Returns:
      a reference