Skip to content

Commit df1301b

Browse files
authored
Make org.bukkit.Keyed extend Adventure's Keyed (#7090)
1 parent c1bd3cc commit df1301b

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

patches/api/0008-Adventure.patch

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,36 @@ index cc42bfa74b41ef6d6374efa7b882f71677fb0824..ef06bd2972e0a4e7ffa0e91d2b0de5d7
682682
public static String getShutdownMessage() {
683683
return server.getShutdownMessage();
684684
}
685+
diff --git a/src/main/java/org/bukkit/Keyed.java b/src/main/java/org/bukkit/Keyed.java
686+
index 32c92621c2c15eec14c50965f5ecda00c46e6c80..e076d447da62445764a9776ee2554c077637d270 100644
687+
--- a/src/main/java/org/bukkit/Keyed.java
688+
+++ b/src/main/java/org/bukkit/Keyed.java
689+
@@ -5,7 +5,7 @@ import org.jetbrains.annotations.NotNull;
690+
/**
691+
* Represents an object which has a {@link NamespacedKey} attached to it.
692+
*/
693+
-public interface Keyed {
694+
+public interface Keyed extends net.kyori.adventure.key.Keyed { // Paper -- extend Adventure Keyed
695+
696+
/**
697+
* Return the namespaced identifier for this object.
698+
@@ -14,4 +14,16 @@ public interface Keyed {
699+
*/
700+
@NotNull
701+
NamespacedKey getKey();
702+
+
703+
+ // Paper start
704+
+ /**
705+
+ * Returns the unique identifier for this object.
706+
+ *
707+
+ * @return this object's key
708+
+ */
709+
+ @Override
710+
+ default net.kyori.adventure.key.@NotNull Key key() {
711+
+ return this.getKey();
712+
+ }
713+
+ // Paper end
714+
}
685715
diff --git a/src/main/java/org/bukkit/Nameable.java b/src/main/java/org/bukkit/Nameable.java
686716
index fee814e01a653d2b53c56e8b566383ca44aa5346..2acdf2a6d3955923c721222b9da784f3278f6418 100644
687717
--- a/src/main/java/org/bukkit/Nameable.java

0 commit comments

Comments
 (0)