Finish converting most of the undeprecated api to jspecify

This commit is contained in:
Jake Potrebic 2024-09-30 11:44:36 -07:00
parent ba3c29b92e
commit e7e1ab56ca
No known key found for this signature in database
GPG key ID: ECE0B3C133C016C5
45 changed files with 1046 additions and 982 deletions

View file

@ -7,10 +7,10 @@ Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
diff --git a/src/main/java/io/papermc/paper/advancement/AdvancementDisplay.java b/src/main/java/io/papermc/paper/advancement/AdvancementDisplay.java
new file mode 100644
index 0000000000000000000000000000000000000000..19202e17f362fdffca472178b102d1336349590c
index 0000000000000000000000000000000000000000..59228f2e66e982feca77d9f962004ceacb648783
--- /dev/null
+++ b/src/main/java/io/papermc/paper/advancement/AdvancementDisplay.java
@@ -0,0 +1,166 @@
@@ -0,0 +1,160 @@
+package io.papermc.paper.advancement;
+
+import net.kyori.adventure.text.Component;
@ -20,8 +20,8 @@ index 0000000000000000000000000000000000000000..19202e17f362fdffca472178b102d133
+import net.kyori.adventure.util.Index;
+import org.bukkit.NamespacedKey;
+import org.bukkit.inventory.ItemStack;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.jspecify.annotations.NullMarked;
+import org.jspecify.annotations.Nullable;
+
+/**
+ * Describes the display of an advancement.
@ -29,6 +29,7 @@ index 0000000000000000000000000000000000000000..19202e17f362fdffca472178b102d133
+ * The display is used in the chat, in the toast messages and the advancements
+ * screen.
+ */
+@NullMarked
+public interface AdvancementDisplay {
+
+ /**
@ -39,7 +40,6 @@ index 0000000000000000000000000000000000000000..19202e17f362fdffca472178b102d133
+ *
+ * @return the frame type
+ */
+ @NotNull
+ Frame frame();
+
+ /**
@ -47,7 +47,6 @@ index 0000000000000000000000000000000000000000..19202e17f362fdffca472178b102d133
+ *
+ * @return the title
+ */
+ @NotNull
+ Component title();
+
+ /**
@ -55,7 +54,6 @@ index 0000000000000000000000000000000000000000..19202e17f362fdffca472178b102d133
+ *
+ * @return the description
+ */
+ @NotNull
+ Component description();
+
+ /**
@ -63,7 +61,6 @@ index 0000000000000000000000000000000000000000..19202e17f362fdffca472178b102d133
+ *
+ * @return a copy of the icon
+ */
+ @NotNull
+ ItemStack icon();
+
+ /**
@ -104,8 +101,7 @@ index 0000000000000000000000000000000000000000..19202e17f362fdffca472178b102d133
+ *
+ * @return the background texture path
+ */
+ @Nullable
+ NamespacedKey backgroundPath();
+ @Nullable NamespacedKey backgroundPath();
+
+ /**
+ * Gets the formatted display name for this display. This
@ -115,7 +111,7 @@ index 0000000000000000000000000000000000000000..19202e17f362fdffca472178b102d133
+ * @return the display name
+ * @see org.bukkit.advancement.Advancement#displayName()
+ */
+ @NotNull Component displayName();
+ Component displayName();
+
+ /**
+ * Defines how the {@link #icon()} appears in the advancements screen and
@ -148,7 +144,7 @@ index 0000000000000000000000000000000000000000..19202e17f362fdffca472178b102d133
+ private final String name;
+ private final TextColor color;
+
+ Frame(String name, TextColor color) {
+ Frame(final String name, final TextColor color) {
+ this.name = name;
+ this.color = color;
+ }
@ -158,7 +154,6 @@ index 0000000000000000000000000000000000000000..19202e17f362fdffca472178b102d133
+ *
+ * @return the text color
+ */
+ @NotNull
+ public TextColor color() {
+ return this.color;
+ }
@ -171,7 +166,6 @@ index 0000000000000000000000000000000000000000..19202e17f362fdffca472178b102d133
+ * @return the toast message key
+ */
+ @Override
+ @NotNull
+ public String translationKey() {
+ return "advancements.toast." + this.name;
+ }