Kill the NotNull annotation

This commit is contained in:
masmc05 2024-10-05 04:30:33 +03:00
parent 2716a6bbcb
commit da6657ece4
No known key found for this signature in database
GPG key ID: 9EC8F5B2CFD24E42

View file

@ -5,24 +5,16 @@ Subject: [PATCH] Add ItemStack#effectiveName
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
index f84e07fa0876bb6da0f99f4de6cb811f897adca2..e2191bc42951760b67e475e50be38c6abb3a77b7 100644
index f84e07fa0876bb6da0f99f4de6cb811f897adca2..c6a24aca51a612a02f677f2870b5afcfb7b2d47e 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -22,6 +22,7 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.material.MaterialData;
import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
@DelegateDeserialization(ItemStack.class)
public final class CraftItemStack extends ItemStack {
@@ -438,6 +439,23 @@ public final class CraftItemStack extends ItemStack {
@@ -438,6 +438,23 @@ public final class CraftItemStack extends ItemStack {
return true;
}
+ // Paper start - add ItemStack#effectiveName
+ @Override
+ public @NotNull net.kyori.adventure.text.Component effectiveName() {
+ public net.kyori.adventure.text.Component effectiveName() {
+ // 1.21.2: return this.handle == null ? net.kyori.adventure.text.Component.empty() : io.papermc.paper.adventure.PaperAdventure.asAdventure(this.handle.getStyledHoverName());
+ if (this.handle == null) {
+ return net.kyori.adventure.text.Component.empty();