From 47bbe06dd1cec07f4db46e9ed0bdb345e80ab4ae Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Sat, 7 Dec 2024 19:12:26 +0100 Subject: Add apiNote to ItemMeta methods --- patches/api/0006-Adventure.patch | 23 ++++++++++++---------- patches/api/0053-Fix-upstream-javadocs.patch | 12 +++++------ .../api/0166-Fix-Spigot-annotation-mistakes.patch | 10 +++++----- .../api/0193-Support-components-in-ItemMeta.patch | 10 +++++----- patches/api/0468-General-ItemMeta-fixes.patch | 6 +++--- ...-for-CanPlaceOn-and-CanDestroy-NBT-values.patch | 4 ++-- 6 files changed, 34 insertions(+), 31 deletions(-) diff --git a/patches/api/0006-Adventure.patch b/patches/api/0006-Adventure.patch index 2c4b796fa9..43d2ca5547 100644 --- a/patches/api/0006-Adventure.patch +++ b/patches/api/0006-Adventure.patch @@ -4713,10 +4713,10 @@ index 9bab73c3c2ca759b8e1c7d07d98cc593c961666a..f0c6943da3f783101ca647b75b3230fa throw new UnsupportedOperationException("Not supported yet."); } diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java -index 69d6de6e9618dd27f5ba73b931f8455912caf060..1181d62f13ad53a47bf3280f00f7ed45c826908f 100644 +index 69d6de6e9618dd27f5ba73b931f8455912caf060..753a756525f6afea981dd0c2984e7a747d4d148b 100644 --- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java +++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java -@@ -38,12 +38,62 @@ import org.jetbrains.annotations.Nullable; +@@ -38,12 +38,65 @@ import org.jetbrains.annotations.Nullable; */ public interface ItemMeta extends Cloneable, ConfigurationSerializable, PersistentDataHolder { @@ -4747,6 +4747,7 @@ index 69d6de6e9618dd27f5ba73b931f8455912caf060..1181d62f13ad53a47bf3280f00f7ed45 /** * Checks for existence of a display name. * ++ * @apiNote This method is obsolete, use {@link #hasCustomName()} instead. * @return true if this has a display name */ - boolean hasDisplayName(); @@ -4760,6 +4761,7 @@ index 69d6de6e9618dd27f5ba73b931f8455912caf060..1181d62f13ad53a47bf3280f00f7ed45 + * + *

Plugins should check that {@link #hasDisplayName()} returns true before calling this method.

+ * ++ * @apiNote This method is obsolete, use {@link #customName()} instead. + * @return the display name + */ + @ApiStatus.Obsolete(since = "1.21.4") @@ -4771,6 +4773,7 @@ index 69d6de6e9618dd27f5ba73b931f8455912caf060..1181d62f13ad53a47bf3280f00f7ed45 + * Sets the display name. + * + * @param displayName the display name to set ++ * @apiNote This method is obsolete, use {@link #customName(Component)} instead. + */ + @ApiStatus.Obsolete(since = "1.21.4") + default void displayName(final net.kyori.adventure.text.@Nullable Component displayName) { @@ -4780,7 +4783,7 @@ index 69d6de6e9618dd27f5ba73b931f8455912caf060..1181d62f13ad53a47bf3280f00f7ed45 /** * Gets the display name that is set. -@@ -52,7 +102,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste +@@ -52,7 +105,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste * before calling this method. * * @return the display name that is set @@ -4790,7 +4793,7 @@ index 69d6de6e9618dd27f5ba73b931f8455912caf060..1181d62f13ad53a47bf3280f00f7ed45 @NotNull String getDisplayName(); -@@ -60,7 +112,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste +@@ -60,7 +115,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste * Sets the display name. * * @param name the name to set @@ -4800,7 +4803,7 @@ index 69d6de6e9618dd27f5ba73b931f8455912caf060..1181d62f13ad53a47bf3280f00f7ed45 void setDisplayName(@Nullable String name); /** -@@ -73,6 +127,32 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste +@@ -73,6 +130,32 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste */ boolean hasItemName(); @@ -4833,7 +4836,7 @@ index 69d6de6e9618dd27f5ba73b931f8455912caf060..1181d62f13ad53a47bf3280f00f7ed45 /** * Gets the item name that is set. *
-@@ -83,7 +163,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste +@@ -83,7 +166,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste * calling this method. * * @return the item name that is set @@ -4843,7 +4846,7 @@ index 69d6de6e9618dd27f5ba73b931f8455912caf060..1181d62f13ad53a47bf3280f00f7ed45 @NotNull String getItemName(); -@@ -94,7 +176,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste +@@ -94,7 +179,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste * anvil, is not styled with italics, and does not show labels. * * @param name the name to set @@ -4853,7 +4856,7 @@ index 69d6de6e9618dd27f5ba73b931f8455912caf060..1181d62f13ad53a47bf3280f00f7ed45 void setItemName(@Nullable String name); /** -@@ -135,6 +219,24 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste +@@ -135,6 +222,24 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste */ boolean hasLore(); @@ -4878,7 +4881,7 @@ index 69d6de6e9618dd27f5ba73b931f8455912caf060..1181d62f13ad53a47bf3280f00f7ed45 /** * Gets the lore that is set. *

-@@ -142,7 +244,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste +@@ -142,7 +247,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste * calling this method. * * @return a list of lore that is set @@ -4888,7 +4891,7 @@ index 69d6de6e9618dd27f5ba73b931f8455912caf060..1181d62f13ad53a47bf3280f00f7ed45 @Nullable List getLore(); -@@ -151,7 +255,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste +@@ -151,7 +258,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste * Removes lore when given null. * * @param lore the lore that will be set diff --git a/patches/api/0053-Fix-upstream-javadocs.patch b/patches/api/0053-Fix-upstream-javadocs.patch index 39adffa948..914dbd4293 100644 --- a/patches/api/0053-Fix-upstream-javadocs.patch +++ b/patches/api/0053-Fix-upstream-javadocs.patch @@ -1622,10 +1622,10 @@ index 35c6594fd1040a1af1029e7260e5e3a9307b107d..d58719ee75bef8bc265bfc81bc5d88a4 void addChargedProjectile(@NotNull ItemStack item); } diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java -index 1181d62f13ad53a47bf3280f00f7ed45c826908f..93cce20187ae7142977233f5520e672cb554e369 100644 +index 753a756525f6afea981dd0c2984e7a747d4d148b..c083ac4344dd1b2b56cbe103ce80daac945defd5 100644 --- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java +++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java -@@ -325,7 +325,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste +@@ -328,7 +328,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste /** * Gets the enchantable component. Higher values allow higher enchantments. * @@ -1634,7 +1634,7 @@ index 1181d62f13ad53a47bf3280f00f7ed45c826908f..93cce20187ae7142977233f5520e672c */ int getEnchantable(); -@@ -658,11 +658,6 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste +@@ -661,11 +661,6 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste /** * Gets the item which this item will convert to when used. @@ -1646,7 +1646,7 @@ index 1181d62f13ad53a47bf3280f00f7ed45c826908f..93cce20187ae7142977233f5520e672c * * @return remainder */ -@@ -799,7 +794,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste +@@ -802,7 +797,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste * The returned component is a snapshot of its current state and does not * reflect a live view of what is on an item. After changing any value on * this component, it must be set with @@ -1655,7 +1655,7 @@ index 1181d62f13ad53a47bf3280f00f7ed45c826908f..93cce20187ae7142977233f5520e672c * to apply the changes. * * @return component -@@ -808,7 +803,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste +@@ -811,7 +806,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste JukeboxPlayableComponent getJukeboxPlayable(); /** @@ -1664,7 +1664,7 @@ index 1181d62f13ad53a47bf3280f00f7ed45c826908f..93cce20187ae7142977233f5520e672c * * @param jukeboxPlayable new component */ -@@ -835,7 +830,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste +@@ -838,7 +833,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste /** * Return an immutable copy of all {@link Attribute}s and their * {@link AttributeModifier}s for a given {@link EquipmentSlot}.
diff --git a/patches/api/0166-Fix-Spigot-annotation-mistakes.patch b/patches/api/0166-Fix-Spigot-annotation-mistakes.patch index 2f41d87f87..57ee023c57 100644 --- a/patches/api/0166-Fix-Spigot-annotation-mistakes.patch +++ b/patches/api/0166-Fix-Spigot-annotation-mistakes.patch @@ -1748,10 +1748,10 @@ index 597a18a767b68b47e81454b7d44613c7178c1366..bc3440eb72127824b3961fbdae583bb6 public ItemStack getInput() { return this.ingredient.getItemStack(); diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java -index 93cce20187ae7142977233f5520e672cb554e369..e05b63c1394c5e0a34b469a8ae589480b741d548 100644 +index c083ac4344dd1b2b56cbe103ce80daac945defd5..4012a1b4e9acdfafb38c78a54c4b422ffa07cf04 100644 --- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java +++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java -@@ -184,6 +184,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste +@@ -187,6 +187,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste /** * Checks for existence of a localized name. * @@ -1759,7 +1759,7 @@ index 93cce20187ae7142977233f5520e672cb554e369..e05b63c1394c5e0a34b469a8ae589480 * @return true if this has a localized name * @deprecated meta no longer exists */ -@@ -196,6 +197,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste +@@ -199,6 +200,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste * Plugins should check that hasLocalizedName() returns true * before calling this method. * @@ -1767,7 +1767,7 @@ index 93cce20187ae7142977233f5520e672cb554e369..e05b63c1394c5e0a34b469a8ae589480 * @return the localized name that is set * @deprecated meta no longer exists */ -@@ -206,6 +208,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste +@@ -209,6 +211,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste /** * Sets the localized name. * @@ -1775,7 +1775,7 @@ index 93cce20187ae7142977233f5520e672cb554e369..e05b63c1394c5e0a34b469a8ae589480 * @param name the name to set * @deprecated meta no longer exists */ -@@ -799,7 +802,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste +@@ -802,7 +805,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste * * @return component */ diff --git a/patches/api/0193-Support-components-in-ItemMeta.patch b/patches/api/0193-Support-components-in-ItemMeta.patch index 3967ed633c..6de921bc0b 100644 --- a/patches/api/0193-Support-components-in-ItemMeta.patch +++ b/patches/api/0193-Support-components-in-ItemMeta.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Support components in ItemMeta diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java -index e05b63c1394c5e0a34b469a8ae589480b741d548..261978893988ed5fba1889ba8ce5ae84897a0653 100644 +index 4012a1b4e9acdfafb38c78a54c4b422ffa07cf04..cca91212e702a73e9fc37ec46d575967fedf68c9 100644 --- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java +++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java @@ -5,6 +5,7 @@ import java.util.Collection; @@ -16,7 +16,7 @@ index e05b63c1394c5e0a34b469a8ae589480b741d548..261978893988ed5fba1889ba8ce5ae84 import org.bukkit.NamespacedKey; import org.bukkit.Tag; import org.bukkit.attribute.Attribute; -@@ -108,6 +109,20 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste +@@ -111,6 +112,20 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste @NotNull String getDisplayName(); @@ -37,7 +37,7 @@ index e05b63c1394c5e0a34b469a8ae589480b741d548..261978893988ed5fba1889ba8ce5ae84 /** * Sets the display name. * -@@ -117,6 +132,16 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste +@@ -120,6 +135,16 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste @Deprecated // Paper void setDisplayName(@Nullable String name); @@ -54,7 +54,7 @@ index e05b63c1394c5e0a34b469a8ae589480b741d548..261978893988ed5fba1889ba8ce5ae84 /** * Checks for existence of an item name. *
-@@ -253,6 +278,19 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste +@@ -256,6 +281,19 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste @Nullable List getLore(); @@ -74,7 +74,7 @@ index e05b63c1394c5e0a34b469a8ae589480b741d548..261978893988ed5fba1889ba8ce5ae84 /** * Sets the lore for this item. * Removes lore when given null. -@@ -263,6 +301,16 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste +@@ -266,6 +304,16 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste @Deprecated // Paper void setLore(@Nullable List lore); diff --git a/patches/api/0468-General-ItemMeta-fixes.patch b/patches/api/0468-General-ItemMeta-fixes.patch index f289634830..b8a63b49f7 100644 --- a/patches/api/0468-General-ItemMeta-fixes.patch +++ b/patches/api/0468-General-ItemMeta-fixes.patch @@ -112,10 +112,10 @@ index ff6818b6d9e0207eafdd749928f33aeac3f27191..992f39da07bafe9769effaa7dc6adc01 * Checks to see if this item has a maximum amount of damage. * diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java -index 261978893988ed5fba1889ba8ce5ae84897a0653..16a0c8215c9cd0940fb3fbb2617569279d371a13 100644 +index cca91212e702a73e9fc37ec46d575967fedf68c9..2035d54de7e446930f8fdd2a572240e70a21c656 100644 --- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java +++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java -@@ -383,7 +383,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste +@@ -386,7 +386,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste /** * Sets the enchantable. Higher values allow higher enchantments. * @@ -124,7 +124,7 @@ index 261978893988ed5fba1889ba8ce5ae84897a0653..16a0c8215c9cd0940fb3fbb261756927 */ void setEnchantable(@Nullable Integer enchantable); -@@ -927,8 +927,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste +@@ -930,8 +930,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste /** * Set all {@link Attribute}s and their {@link AttributeModifier}s. diff --git a/patches/api/0478-Add-an-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch b/patches/api/0478-Add-an-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch index 7481c595f4..7df8899b63 100644 --- a/patches/api/0478-Add-an-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch +++ b/patches/api/0478-Add-an-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch @@ -228,10 +228,10 @@ index 6d266c111bfa2bd51338e03ed740f6ac81ed07c7..d71531c384c57ea44d1e1fbe394214c1 return key; } diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java -index 16a0c8215c9cd0940fb3fbb2617569279d371a13..115c1d9fd1961499065a7fcd9aadc69095ec6778 100644 +index 2035d54de7e446930f8fdd2a572240e70a21c656..e8c0b8848abce2c9e8b2be880de3897292f0b23e 100644 --- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java +++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java -@@ -1060,4 +1060,98 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste +@@ -1063,4 +1063,98 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste @SuppressWarnings("javadoc") @NotNull ItemMeta clone(); -- cgit v1.2.3