From df1301b53a0a007a6817f34228e98aeecae3a353 Mon Sep 17 00:00:00 2001 From: Lexi Date: Sun, 12 Dec 2021 23:26:19 -0500 Subject: [PATCH] Make org.bukkit.Keyed extend Adventure's Keyed (#7090) --- patches/api/0008-Adventure.patch | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/patches/api/0008-Adventure.patch b/patches/api/0008-Adventure.patch index 3d79cfed1..b6599a84a 100644 --- a/patches/api/0008-Adventure.patch +++ b/patches/api/0008-Adventure.patch @@ -682,6 +682,36 @@ index cc42bfa74b41ef6d6374efa7b882f71677fb0824..ef06bd2972e0a4e7ffa0e91d2b0de5d7 public static String getShutdownMessage() { return server.getShutdownMessage(); } +diff --git a/src/main/java/org/bukkit/Keyed.java b/src/main/java/org/bukkit/Keyed.java +index 32c92621c2c15eec14c50965f5ecda00c46e6c80..e076d447da62445764a9776ee2554c077637d270 100644 +--- a/src/main/java/org/bukkit/Keyed.java ++++ b/src/main/java/org/bukkit/Keyed.java +@@ -5,7 +5,7 @@ import org.jetbrains.annotations.NotNull; + /** + * Represents an object which has a {@link NamespacedKey} attached to it. + */ +-public interface Keyed { ++public interface Keyed extends net.kyori.adventure.key.Keyed { // Paper -- extend Adventure Keyed + + /** + * Return the namespaced identifier for this object. +@@ -14,4 +14,16 @@ public interface Keyed { + */ + @NotNull + NamespacedKey getKey(); ++ ++ // Paper start ++ /** ++ * Returns the unique identifier for this object. ++ * ++ * @return this object's key ++ */ ++ @Override ++ default net.kyori.adventure.key.@NotNull Key key() { ++ return this.getKey(); ++ } ++ // Paper end + } diff --git a/src/main/java/org/bukkit/Nameable.java b/src/main/java/org/bukkit/Nameable.java index fee814e01a653d2b53c56e8b566383ca44aa5346..2acdf2a6d3955923c721222b9da784f3278f6418 100644 --- a/src/main/java/org/bukkit/Nameable.java