From da6657ece416f4d42af0254e9e2665b61bc95657 Mon Sep 17 00:00:00 2001 From: masmc05 Date: Sat, 5 Oct 2024 04:30:33 +0300 Subject: [PATCH] Kill the NotNull annotation --- .../server/1065-Add-ItemStack-effectiveName.patch | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/patches/server/1065-Add-ItemStack-effectiveName.patch b/patches/server/1065-Add-ItemStack-effectiveName.patch index ff410523ef..d003da1f01 100644 --- a/patches/server/1065-Add-ItemStack-effectiveName.patch +++ b/patches/server/1065-Add-ItemStack-effectiveName.patch @@ -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();