aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0432-Improve-Registry.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/api/0432-Improve-Registry.patch')
-rw-r--r--patches/api/0432-Improve-Registry.patch46
1 files changed, 41 insertions, 5 deletions
diff --git a/patches/api/0432-Improve-Registry.patch b/patches/api/0432-Improve-Registry.patch
index 5e72c2ab2a..1ae2f1b345 100644
--- a/patches/api/0432-Improve-Registry.patch
+++ b/patches/api/0432-Improve-Registry.patch
@@ -9,8 +9,26 @@ 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.
+diff --git a/src/main/java/org/bukkit/Art.java b/src/main/java/org/bukkit/Art.java
+index 042d1d932a33022e4fc873652f70dc6ed342d46a..dbbd997d4693f1d9f551bae2ed1d7906c9f39c12 100644
+--- a/src/main/java/org/bukkit/Art.java
++++ b/src/main/java/org/bukkit/Art.java
+@@ -103,6 +103,13 @@ public enum Art implements Keyed {
+ return id;
+ }
+
++ // Paper start - deprecate getKey
++ /**
++ * @deprecated use {@link Registry#getKey(Keyed)} and {@link Registry#ART}. Painting variants
++ * can exist without a key.
++ */
++ @Deprecated(since = "1.21")
++ // Paper end - deprecate getKey
+ @NotNull
+ @Override
+ public NamespacedKey getKey() {
diff --git a/src/main/java/org/bukkit/MusicInstrument.java b/src/main/java/org/bukkit/MusicInstrument.java
-index 62d2b3f950860dee0898d77b0a29635c3f9a7e23..704dba92f9246ef398ed8d162ebee3cf305960e1 100644
+index 62d2b3f950860dee0898d77b0a29635c3f9a7e23..98fdfc8978fea1937e31a7427433a1927d42ec7d 100644
--- a/src/main/java/org/bukkit/MusicInstrument.java
+++ b/src/main/java/org/bukkit/MusicInstrument.java
@@ -53,6 +53,16 @@ public abstract class MusicInstrument implements Keyed, net.kyori.adventure.tran
@@ -22,7 +40,7 @@ index 62d2b3f950860dee0898d77b0a29635c3f9a7e23..704dba92f9246ef398ed8d162ebee3cf
+ * @deprecated use {@link Registry#getKey(Keyed)} and {@link Registry#INSTRUMENT}. MusicInstruments
+ * can exist without a key.
+ */
-+ @Deprecated
++ @Deprecated(forRemoval = true, since = "1.20.5")
+ @Override
+ public abstract @NotNull NamespacedKey getKey();
+ // Paper end - deprecate getKey
@@ -31,7 +49,7 @@ index 62d2b3f950860dee0898d77b0a29635c3f9a7e23..704dba92f9246ef398ed8d162ebee3cf
@Override
public @NotNull String translationKey() {
diff --git a/src/main/java/org/bukkit/Registry.java b/src/main/java/org/bukkit/Registry.java
-index 0ee9a8728035217bb95c7fba917b45a5ef2ea533..cd1e38debbec745dd13cd895327f544dcf42594d 100644
+index 1df2b8fcf90333d5981f16d9dddddd48289f94e4..5d21459e9128c515508a2b4b2265d9824e10d9d5 100644
--- a/src/main/java/org/bukkit/Registry.java
+++ b/src/main/java/org/bukkit/Registry.java
@@ -359,6 +359,79 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
@@ -127,8 +145,26 @@ index 0ee9a8728035217bb95c7fba917b45a5ef2ea533..cd1e38debbec745dd13cd895327f544d
+ // Paper end - improve Registry
}
}
+diff --git a/src/main/java/org/bukkit/Sound.java b/src/main/java/org/bukkit/Sound.java
+index 8c7b50906fc5b84c5570408f357410810bbfbded..7a35120c82b88774de777d3c3176ef553a8e9244 100644
+--- a/src/main/java/org/bukkit/Sound.java
++++ b/src/main/java/org/bukkit/Sound.java
+@@ -1636,6 +1636,13 @@ public enum Sound implements Keyed, net.kyori.adventure.sound.Sound.Type { // Pa
+ this.key = NamespacedKey.minecraft(key);
+ }
+
++ // Paper start - deprecate getKey
++ /**
++ * @deprecated use {@link Registry#getKey(Keyed)} and {@link Registry#SOUNDS}. Sounds
++ * can exist without a key.
++ */
++ @Deprecated(since = "1.20.5")
++ // Paper end - deprecate getKey
+ @NotNull
+ @Override
+ public NamespacedKey getKey() {
diff --git a/src/main/java/org/bukkit/block/banner/PatternType.java b/src/main/java/org/bukkit/block/banner/PatternType.java
-index 9e90572745909538e942b7fbe788b5286c6cc9a3..100f93358e0a1fa8507775a2afd29314ff353a87 100644
+index 9e90572745909538e942b7fbe788b5286c6cc9a3..e2afb2582a27b94a922754115dbb6b4ca35e0154 100644
--- a/src/main/java/org/bukkit/block/banner/PatternType.java
+++ b/src/main/java/org/bukkit/block/banner/PatternType.java
@@ -56,6 +56,13 @@ public interface PatternType extends OldEnum<PatternType>, Keyed {
@@ -140,7 +176,7 @@ index 9e90572745909538e942b7fbe788b5286c6cc9a3..100f93358e0a1fa8507775a2afd29314
+ * @deprecated use {@link Registry#getKey(Keyed)} and {@link Registry#BANNER_PATTERN}. PatternTypes
+ * can exist without a key.
+ */
-+ @Deprecated
++ @Deprecated(since = "1.20.5")
+ // Paper end - deprecate getKey
@Override
@NotNull