3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-14 20:10:05 +01:00

Kill the NotNull annotation

Dieser Commit ist enthalten in:
masmc05 2024-10-05 04:30:33 +03:00
Ursprung 2716a6bbcb
Commit da6657ece4
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 9EC8F5B2CFD24E42

Datei anzeigen

@ -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 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 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/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; @@ -438,6 +438,23 @@ public final class CraftItemStack extends 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 {
return true; return true;
} }
+ // Paper start - add ItemStack#effectiveName + // Paper start - add ItemStack#effectiveName
+ @Override + @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()); + // 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) { + if (this.handle == null) {
+ return net.kyori.adventure.text.Component.empty(); + return net.kyori.adventure.text.Component.empty();