2023-12-23 22:16:27 +01:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
|
|
|
Date: Wed, 20 Dec 2023 02:03:10 -0800
|
|
|
|
Subject: [PATCH] Improve Registry
|
|
|
|
|
|
|
|
Adds Registry#getKey(Object) which should be the
|
|
|
|
primary way people get the key for an object. Registry
|
|
|
|
items need to exist without having a key and so
|
|
|
|
getKey() methods on Keyed objects that have a registry
|
|
|
|
are marked as Deprecated or Obsolete.
|
|
|
|
|
2024-08-16 23:21:35 +02:00
|
|
|
diff --git a/src/main/java/org/bukkit/Art.java b/src/main/java/org/bukkit/Art.java
|
2024-11-28 22:51:48 +01:00
|
|
|
index d24bf449f58fd7c1b8ffab8dbc42f9f1fef8c4ef..a53e59e030aea65a99806d5b0375cbb4b7457319 100644
|
2024-08-16 23:21:35 +02:00
|
|
|
--- a/src/main/java/org/bukkit/Art.java
|
|
|
|
+++ b/src/main/java/org/bukkit/Art.java
|
2024-11-28 22:51:48 +01:00
|
|
|
@@ -97,6 +97,26 @@ public interface Art extends OldEnum<Art>, Keyed {
|
2024-11-04 18:42:38 +01:00
|
|
|
@Deprecated(since = "1.6.2")
|
|
|
|
int getId();
|
2024-08-16 23:21:35 +02:00
|
|
|
|
|
|
|
+ // Paper start - deprecate getKey
|
|
|
|
+ /**
|
2024-09-24 02:36:29 +02:00
|
|
|
+ * @deprecated use {@link Registry#getKey(Keyed)}, {@link io.papermc.paper.registry.RegistryAccess#getRegistry(io.papermc.paper.registry.RegistryKey)},
|
|
|
|
+ * and {@link io.papermc.paper.registry.RegistryKey#PAINTING_VARIANT}. Painting variants can exist without a key.
|
2024-08-16 23:21:35 +02:00
|
|
|
+ */
|
2024-11-28 22:51:48 +01:00
|
|
|
+ @Deprecated(since = "1.21", forRemoval = true)
|
2024-11-04 18:42:38 +01:00
|
|
|
+ @Override
|
|
|
|
+ @NotNull NamespacedKey getKey();
|
2024-11-28 22:51:48 +01:00
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @deprecated use {@link Registry#getKey(Keyed)}, {@link io.papermc.paper.registry.RegistryAccess#getRegistry(io.papermc.paper.registry.RegistryKey)},
|
|
|
|
+ * and {@link io.papermc.paper.registry.RegistryKey#PAINTING_VARIANT}. Painting variants can exist without a key.
|
|
|
|
+ */
|
|
|
|
+ @Deprecated(since = "1.21", forRemoval = true)
|
|
|
|
+ @Override
|
|
|
|
+ default net.kyori.adventure.key.@org.jetbrains.annotations.NotNull Key key() {
|
|
|
|
+ return Keyed.super.key();
|
|
|
|
+ }
|
2024-08-16 23:21:35 +02:00
|
|
|
+ // Paper end - deprecate getKey
|
2024-11-04 18:42:38 +01:00
|
|
|
+
|
|
|
|
/**
|
|
|
|
* Get a painting by its numeric ID
|
|
|
|
*
|
2024-04-08 07:20:51 +02:00
|
|
|
diff --git a/src/main/java/org/bukkit/MusicInstrument.java b/src/main/java/org/bukkit/MusicInstrument.java
|
2024-12-03 17:58:41 +01:00
|
|
|
index 3b107e35f006cb1a0745778d99dab0783c67d4d8..d41892af5253623112fb3f8c53958c7914609e30 100644
|
2024-04-08 07:20:51 +02:00
|
|
|
--- a/src/main/java/org/bukkit/MusicInstrument.java
|
|
|
|
+++ b/src/main/java/org/bukkit/MusicInstrument.java
|
2024-11-28 22:51:48 +01:00
|
|
|
@@ -47,6 +47,27 @@ public abstract class MusicInstrument implements Keyed, net.kyori.adventure.tran
|
2024-10-21 00:06:54 +02:00
|
|
|
return Registry.INSTRUMENT.getOrThrow(NamespacedKey.minecraft(key));
|
2024-04-08 07:20:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
+ // Paper start - deprecate getKey
|
|
|
|
+ /**
|
2024-11-09 23:26:01 +01:00
|
|
|
+ * @deprecated use {@link Registry#getKey(Keyed)}, {@link io.papermc.paper.registry.RegistryAccess#getRegistry(io.papermc.paper.registry.RegistryKey)},
|
|
|
|
+ * and {@link io.papermc.paper.registry.RegistryKey#INSTRUMENT}. MusicInstruments can exist without a key.
|
2024-04-08 07:20:51 +02:00
|
|
|
+ */
|
2024-08-16 23:21:35 +02:00
|
|
|
+ @Deprecated(forRemoval = true, since = "1.20.5")
|
2024-04-08 07:20:51 +02:00
|
|
|
+ @Override
|
|
|
|
+ public abstract @NotNull NamespacedKey getKey();
|
2024-11-28 22:51:48 +01:00
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @deprecated use {@link Registry#getKey(Keyed)}, {@link io.papermc.paper.registry.RegistryAccess#getRegistry(io.papermc.paper.registry.RegistryKey)},
|
|
|
|
+ * and {@link io.papermc.paper.registry.RegistryKey#INSTRUMENT}. MusicInstruments can exist without a key.
|
|
|
|
+ */
|
|
|
|
+ @Deprecated(forRemoval = true, since = "1.20.5")
|
|
|
|
+ @Override
|
|
|
|
+ public net.kyori.adventure.key.@org.jetbrains.annotations.NotNull Key key() {
|
|
|
|
+ return Keyed.super.key();
|
|
|
|
+ }
|
|
|
|
+
|
2024-04-08 07:20:51 +02:00
|
|
|
+ // Paper end - deprecate getKey
|
|
|
|
+
|
2024-11-09 23:26:01 +01:00
|
|
|
// Paper start - mark translation key as deprecated
|
|
|
|
/**
|
|
|
|
* @deprecated this method assumes that the instrument description
|
2023-12-23 22:16:27 +01:00
|
|
|
diff --git a/src/main/java/org/bukkit/Registry.java b/src/main/java/org/bukkit/Registry.java
|
2024-11-28 22:51:48 +01:00
|
|
|
index b2bd12736d08fe72128142af4ca2022da8309f6d..c3d49f9c640eb390f507f9521a389cb7c172983a 100644
|
2023-12-23 22:16:27 +01:00
|
|
|
--- a/src/main/java/org/bukkit/Registry.java
|
|
|
|
+++ b/src/main/java/org/bukkit/Registry.java
|
2024-11-09 23:26:01 +01:00
|
|
|
@@ -385,6 +385,79 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
|
2023-12-23 22:16:27 +01:00
|
|
|
@Nullable
|
|
|
|
T get(@NotNull NamespacedKey key);
|
|
|
|
|
|
|
|
+ // Paper start - improve Registry
|
|
|
|
+ /**
|
2024-06-16 21:39:59 +02:00
|
|
|
+ * Gets the object by its key or throws if it doesn't exist.
|
|
|
|
+ *
|
|
|
|
+ * @param key the key to get the object of in this registry
|
|
|
|
+ * @return the object for the key
|
|
|
|
+ * @throws java.util.NoSuchElementException if the key doesn't point to an object in the registry
|
|
|
|
+ */
|
|
|
|
+ default @NotNull T getOrThrow(final net.kyori.adventure.key.@NotNull Key key) {
|
|
|
|
+ final T value = this.get(key);
|
|
|
|
+ if (value == null) {
|
|
|
|
+ throw new java.util.NoSuchElementException("No value for " + key + " in " + this);
|
|
|
|
+ }
|
|
|
|
+ return value;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Gets the object by its key or throws if it doesn't exist.
|
|
|
|
+ *
|
|
|
|
+ * @param key the key to get the object of in this registry
|
|
|
|
+ * @return the object for the key
|
|
|
|
+ * @throws java.util.NoSuchElementException if the key doesn't point to an object in the registry
|
|
|
|
+ */
|
|
|
|
+ default @NotNull T getOrThrow(final io.papermc.paper.registry.@NotNull TypedKey<T> key) {
|
|
|
|
+ final T value = this.get(key);
|
|
|
|
+ if (value == null) {
|
|
|
|
+ throw new java.util.NoSuchElementException("No value for " + key + " in " + this);
|
|
|
|
+ }
|
|
|
|
+ return value;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
2023-12-23 22:16:27 +01:00
|
|
|
+ * Gets the key for this object or throws if it doesn't exist.
|
|
|
|
+ * <p>
|
|
|
|
+ * Some types can exist without being in a registry
|
|
|
|
+ * and such will have no key associated with them. This
|
|
|
|
+ * method throw an exception if it isn't in this registry.
|
|
|
|
+ *
|
|
|
|
+ * @param value the value to get the key of in this registry
|
|
|
|
+ * @return the key for the value
|
|
|
|
+ * @throws java.util.NoSuchElementException if the value doesn't exist in this registry
|
|
|
|
+ * @see #getKey(Keyed)
|
|
|
|
+ */
|
|
|
|
+ default @NotNull NamespacedKey getKeyOrThrow(final @NotNull T value) {
|
|
|
|
+ Preconditions.checkArgument(value != null, "value cannot be null");
|
|
|
|
+ final NamespacedKey key = this.getKey(value);
|
|
|
|
+ if (key == null) {
|
|
|
|
+ throw new java.util.NoSuchElementException(value + " has no key in " + this);
|
|
|
|
+ }
|
|
|
|
+ return key;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Get the key for this object.
|
|
|
|
+ * <p>
|
|
|
|
+ * Some types can exist without being in a registry
|
|
|
|
+ * and such will have no key associated with them. This
|
|
|
|
+ * method will return null.
|
|
|
|
+ *
|
|
|
|
+ * @param value the value to get the key of in this registry
|
|
|
|
+ * @return the key for the value or null if not in the registry
|
|
|
|
+ * @see #getKeyOrThrow(Keyed)
|
|
|
|
+ */
|
|
|
|
+ default @Nullable NamespacedKey getKey(final @NotNull T value) {
|
|
|
|
+ Preconditions.checkArgument(value != null, "value cannot be null");
|
|
|
|
+ //noinspection ConstantValue (it might not be in the future...)
|
|
|
|
+ if (value instanceof Keyed) {
|
|
|
|
+ return value.getKey();
|
|
|
|
+ }
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ // Paper end - improve Registry
|
|
|
|
+
|
|
|
|
/**
|
2024-10-21 00:06:54 +02:00
|
|
|
* Get the object by its key.
|
2023-12-23 22:16:27 +01:00
|
|
|
*
|
2024-11-09 23:26:01 +01:00
|
|
|
@@ -481,5 +554,12 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
|
2024-05-11 23:48:37 +02:00
|
|
|
public Class<T> getType() {
|
|
|
|
return this.type;
|
2023-12-23 22:16:27 +01:00
|
|
|
}
|
|
|
|
+
|
|
|
|
+ // Paper start - improve Registry
|
|
|
|
+ @Override
|
|
|
|
+ public @NotNull NamespacedKey getKey(final @NotNull T value) {
|
|
|
|
+ return value.getKey();
|
|
|
|
+ }
|
|
|
|
+ // Paper end - improve Registry
|
|
|
|
}
|
|
|
|
}
|
2024-08-16 23:21:35 +02:00
|
|
|
diff --git a/src/main/java/org/bukkit/Sound.java b/src/main/java/org/bukkit/Sound.java
|
2024-12-03 17:58:41 +01:00
|
|
|
index 779fd6dd572dea41e7e22464c9c6068a0fb71b9d..70d6dedcad934be38ec5dc3807ec946b0fe3b649 100644
|
2024-08-16 23:21:35 +02:00
|
|
|
--- a/src/main/java/org/bukkit/Sound.java
|
|
|
|
+++ b/src/main/java/org/bukkit/Sound.java
|
2024-12-03 17:58:41 +01:00
|
|
|
@@ -1704,6 +1704,16 @@ public interface Sound extends OldEnum<Sound>, Keyed, net.kyori.adventure.sound.
|
2024-11-04 18:42:38 +01:00
|
|
|
return sound;
|
2024-08-16 23:21:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
+ // Paper start - deprecate getKey
|
|
|
|
+ /**
|
|
|
|
+ * @deprecated use {@link Registry#getKey(Keyed)} and {@link Registry#SOUNDS}. Sounds
|
|
|
|
+ * can exist without a key.
|
|
|
|
+ */
|
2024-11-28 22:51:48 +01:00
|
|
|
+ @Deprecated(since = "1.20.5", forRemoval = true)
|
2024-11-04 18:42:38 +01:00
|
|
|
+ @Override
|
|
|
|
+ @NotNull NamespacedKey getKey();
|
2024-08-16 23:21:35 +02:00
|
|
|
+ // Paper end - deprecate getKey
|
2024-11-04 18:42:38 +01:00
|
|
|
+
|
|
|
|
/**
|
|
|
|
* @return an array of all known sounds.
|
|
|
|
* @deprecated use {@link Registry#iterator()}.
|
2024-12-03 17:58:41 +01:00
|
|
|
@@ -1715,6 +1725,11 @@ public interface Sound extends OldEnum<Sound>, Keyed, net.kyori.adventure.sound.
|
2024-11-28 22:51:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// Paper start
|
|
|
|
+ /**
|
|
|
|
+ * @deprecated use {@link Registry#getKey(Keyed)} and {@link Registry#SOUNDS}. Sounds
|
|
|
|
+ * can exist without a key.
|
|
|
|
+ */
|
|
|
|
+ @Deprecated(since = "1.20.5", forRemoval = true)
|
|
|
|
@Override
|
|
|
|
default net.kyori.adventure.key.@NotNull Key key() {
|
|
|
|
return this.getKey();
|
2024-04-08 07:20:51 +02:00
|
|
|
diff --git a/src/main/java/org/bukkit/block/banner/PatternType.java b/src/main/java/org/bukkit/block/banner/PatternType.java
|
2024-12-03 17:58:41 +01:00
|
|
|
index b6aa112ffcf43c8854e4060a83117cdc311c937d..4620b39b3257a29f964f94a2ddef9c46a365baa1 100644
|
2024-04-08 07:20:51 +02:00
|
|
|
--- a/src/main/java/org/bukkit/block/banner/PatternType.java
|
|
|
|
+++ b/src/main/java/org/bukkit/block/banner/PatternType.java
|
2024-11-28 22:51:48 +01:00
|
|
|
@@ -56,6 +56,23 @@ public interface PatternType extends OldEnum<PatternType>, Keyed {
|
2024-08-09 22:05:50 +02:00
|
|
|
PatternType FLOW = getType("flow");
|
|
|
|
PatternType GUSTER = getType("guster");
|
2024-04-08 07:20:51 +02:00
|
|
|
|
|
|
|
+ // Paper start - deprecate getKey
|
|
|
|
+ /**
|
2024-09-24 02:36:29 +02:00
|
|
|
+ * @deprecated use {@link Registry#getKey(Keyed)}, {@link io.papermc.paper.registry.RegistryAccess#getRegistry(io.papermc.paper.registry.RegistryKey)},
|
|
|
|
+ * and {@link io.papermc.paper.registry.RegistryKey#BANNER_PATTERN}. PatternTypes can exist without a key.
|
2024-04-08 07:20:51 +02:00
|
|
|
+ */
|
2024-11-28 22:51:48 +01:00
|
|
|
+ @Deprecated(since = "1.20.5", forRemoval = true)
|
|
|
|
+ @Override
|
|
|
|
+ default net.kyori.adventure.key.@org.jetbrains.annotations.NotNull Key key() {
|
|
|
|
+ return org.bukkit.Keyed.super.key();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @deprecated use {@link Registry#getKey(Keyed)}, {@link io.papermc.paper.registry.RegistryAccess#getRegistry(io.papermc.paper.registry.RegistryKey)},
|
|
|
|
+ * and {@link io.papermc.paper.registry.RegistryKey#BANNER_PATTERN}. PatternTypes can exist without a key.
|
|
|
|
+ */
|
|
|
|
+ @Deprecated(since = "1.20.5", forRemoval = true)
|
2024-04-08 07:20:51 +02:00
|
|
|
+ // Paper end - deprecate getKey
|
|
|
|
@Override
|
|
|
|
@NotNull
|
2024-08-09 22:05:50 +02:00
|
|
|
public NamespacedKey getKey();
|
2024-04-08 07:20:51 +02:00
|
|
|
diff --git a/src/main/java/org/bukkit/generator/structure/Structure.java b/src/main/java/org/bukkit/generator/structure/Structure.java
|
2024-11-28 22:51:48 +01:00
|
|
|
index 20a7fd27ba3a029d58dd18ad9b470ffaed8c9578..b6920f834f8f5992214734abd093af54fc01991c 100644
|
2024-04-08 07:20:51 +02:00
|
|
|
--- a/src/main/java/org/bukkit/generator/structure/Structure.java
|
|
|
|
+++ b/src/main/java/org/bukkit/generator/structure/Structure.java
|
2024-11-28 22:51:48 +01:00
|
|
|
@@ -61,4 +61,24 @@ public abstract class Structure implements Keyed {
|
2024-04-08 07:20:51 +02:00
|
|
|
*/
|
|
|
|
@NotNull
|
|
|
|
public abstract StructureType getStructureType();
|
|
|
|
+ // Paper start - deprecate getKey
|
|
|
|
+ /**
|
2024-11-09 23:26:01 +01:00
|
|
|
+ * @deprecated use {@link Registry#getKey(Keyed)}, {@link io.papermc.paper.registry.RegistryAccess#getRegistry(io.papermc.paper.registry.RegistryKey)},
|
|
|
|
+ * and {@link io.papermc.paper.registry.RegistryKey#STRUCTURE}. Structures can exist without a key.
|
2024-04-08 07:20:51 +02:00
|
|
|
+ */
|
|
|
|
+ @Override
|
2024-11-28 22:51:48 +01:00
|
|
|
+ @Deprecated(since = "1.20.4", forRemoval = true)
|
2024-04-08 07:20:51 +02:00
|
|
|
+ public abstract @NotNull NamespacedKey getKey();
|
2024-11-28 22:51:48 +01:00
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @deprecated use {@link Registry#getKey(Keyed)}, {@link io.papermc.paper.registry.RegistryAccess#getRegistry(io.papermc.paper.registry.RegistryKey)},
|
|
|
|
+ * and {@link io.papermc.paper.registry.RegistryKey#STRUCTURE}. Structures can exist without a key.
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ @Deprecated(since = "1.20.4", forRemoval = true)
|
|
|
|
+ public net.kyori.adventure.key.@org.jetbrains.annotations.NotNull Key key() {
|
|
|
|
+ return org.bukkit.Keyed.super.key();
|
|
|
|
+ }
|
|
|
|
+
|
2024-04-08 07:20:51 +02:00
|
|
|
+ // Paper end - deprecate getKey
|
|
|
|
}
|
2023-12-23 22:16:27 +01:00
|
|
|
diff --git a/src/main/java/org/bukkit/inventory/meta/trim/TrimMaterial.java b/src/main/java/org/bukkit/inventory/meta/trim/TrimMaterial.java
|
2024-12-03 17:58:41 +01:00
|
|
|
index cc38bee3c412bef4767f08407c0f5559a113fce5..7e8a4b4ec625072cb4aff1f9e113d9d0c162dc8c 100644
|
2023-12-23 22:16:27 +01:00
|
|
|
--- a/src/main/java/org/bukkit/inventory/meta/trim/TrimMaterial.java
|
|
|
|
+++ b/src/main/java/org/bukkit/inventory/meta/trim/TrimMaterial.java
|
2024-12-03 17:58:41 +01:00
|
|
|
@@ -78,4 +78,25 @@ public interface TrimMaterial extends Keyed, Translatable {
|
2024-04-06 21:53:39 +02:00
|
|
|
@Deprecated(forRemoval = true)
|
|
|
|
@org.jetbrains.annotations.NotNull String getTranslationKey();
|
|
|
|
// Paper end - adventure
|
|
|
|
+
|
|
|
|
+ // Paper start - Registry#getKey
|
2023-12-23 22:16:27 +01:00
|
|
|
+ /**
|
2024-09-24 02:36:29 +02:00
|
|
|
+ * @deprecated use {@link Registry#getKey(Keyed)}, {@link io.papermc.paper.registry.RegistryAccess#getRegistry(io.papermc.paper.registry.RegistryKey)},
|
|
|
|
+ * and {@link io.papermc.paper.registry.RegistryKey#TRIM_MATERIAL}. TrimMaterials can exist without a key.
|
2023-12-23 22:16:27 +01:00
|
|
|
+ */
|
|
|
|
+ @Deprecated(forRemoval = true, since = "1.20.4")
|
|
|
|
+ @Override
|
|
|
|
+ org.bukkit.@org.jetbrains.annotations.NotNull NamespacedKey getKey();
|
2024-11-28 22:51:48 +01:00
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @deprecated use {@link Registry#getKey(Keyed)}, {@link io.papermc.paper.registry.RegistryAccess#getRegistry(io.papermc.paper.registry.RegistryKey)},
|
|
|
|
+ * and {@link io.papermc.paper.registry.RegistryKey#TRIM_MATERIAL}. TrimMaterials can exist without a key.
|
|
|
|
+ */
|
|
|
|
+ @Deprecated(forRemoval = true, since = "1.20.4")
|
|
|
|
+ @Override
|
|
|
|
+ default net.kyori.adventure.key.@org.jetbrains.annotations.NotNull Key key() {
|
|
|
|
+ return org.bukkit.Keyed.super.key();
|
|
|
|
+ }
|
|
|
|
+
|
2024-04-06 21:53:39 +02:00
|
|
|
+ // Paper end - Registry#getKey
|
2023-12-23 22:16:27 +01:00
|
|
|
}
|
|
|
|
diff --git a/src/main/java/org/bukkit/inventory/meta/trim/TrimPattern.java b/src/main/java/org/bukkit/inventory/meta/trim/TrimPattern.java
|
2024-11-28 22:51:48 +01:00
|
|
|
index 56cfe665daba1754e41f633d7c18172bebf87028..b2fa0d565b2492aa812b0ac036ecd74889f67f76 100644
|
2023-12-23 22:16:27 +01:00
|
|
|
--- a/src/main/java/org/bukkit/inventory/meta/trim/TrimPattern.java
|
|
|
|
+++ b/src/main/java/org/bukkit/inventory/meta/trim/TrimPattern.java
|
2024-11-28 22:51:48 +01:00
|
|
|
@@ -106,4 +106,24 @@ public interface TrimPattern extends Keyed, Translatable {
|
2024-04-06 21:53:39 +02:00
|
|
|
@Deprecated(forRemoval = true)
|
|
|
|
@org.jetbrains.annotations.NotNull String getTranslationKey();
|
|
|
|
// Paper end - adventure
|
|
|
|
+
|
|
|
|
+ // Paper start - Registry#getKey
|
2023-12-23 22:16:27 +01:00
|
|
|
+ /**
|
2024-09-24 02:36:29 +02:00
|
|
|
+ * @deprecated use {@link Registry#getKey(Keyed)}, {@link io.papermc.paper.registry.RegistryAccess#getRegistry(io.papermc.paper.registry.RegistryKey)},
|
|
|
|
+ * and {@link io.papermc.paper.registry.RegistryKey#TRIM_PATTERN}. TrimPatterns can exist without a key.
|
2023-12-23 22:16:27 +01:00
|
|
|
+ */
|
|
|
|
+ @Deprecated(forRemoval = true, since = "1.20.4")
|
|
|
|
+ @Override
|
|
|
|
+ org.bukkit.@org.jetbrains.annotations.NotNull NamespacedKey getKey();
|
2024-11-28 22:51:48 +01:00
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @deprecated use {@link Registry#getKey(Keyed)}, {@link io.papermc.paper.registry.RegistryAccess#getRegistry(io.papermc.paper.registry.RegistryKey)},
|
|
|
|
+ * and {@link io.papermc.paper.registry.RegistryKey#TRIM_PATTERN}. TrimPatterns can exist without a key.
|
|
|
|
+ */
|
|
|
|
+ @Deprecated(forRemoval = true, since = "1.20.4")
|
|
|
|
+ @Override
|
|
|
|
+ default net.kyori.adventure.key.@org.jetbrains.annotations.NotNull Key key() {
|
|
|
|
+ return org.bukkit.Keyed.super.key();
|
|
|
|
+ }
|
2024-04-06 21:53:39 +02:00
|
|
|
+ // Paper end - Registry#getKey
|
2023-12-23 22:16:27 +01:00
|
|
|
}
|