diff --git a/patches/api/0006-Adventure.patch b/patches/api/0006-Adventure.patch index 0ee6e81107..43d2ca5547 100644 --- a/patches/api/0006-Adventure.patch +++ b/patches/api/0006-Adventure.patch @@ -4713,35 +4713,77 @@ 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..77f0e0a9e991f65b89909d0307fd93c3ecd9d8ac 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 -@@ -45,6 +45,24 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste - */ - boolean hasDisplayName(); +@@ -38,12 +38,65 @@ import org.jetbrains.annotations.Nullable; + */ + public interface ItemMeta extends Cloneable, ConfigurationSerializable, PersistentDataHolder { + // Paper start + /** ++ * Checks for existence of a custom name. ++ * ++ * @return true if this has a custom name ++ */ ++ boolean hasCustomName(); ++ ++ /** ++ * Gets the custom name. ++ * ++ *
Plugins should check that {@link #hasCustomName()} returns {@code true} before calling this method.
++ * ++ * @return the custom name ++ */ ++ net.kyori.adventure.text.@Nullable Component customName(); ++ ++ /** ++ * Sets the custom name. ++ * ++ * @param customName the custom name to set ++ */ ++ void customName(final net.kyori.adventure.text.@Nullable Component customName); ++ + /** + * 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(); ++ @ApiStatus.Obsolete(since = "1.21.4") ++ default boolean hasDisplayName() { ++ return this.hasCustomName(); ++ } ++ ++ /** + * Gets the display name. + * + *Plugins should check that {@link #hasDisplayName()} returns true
before calling this method.
-@@ -52,7 +70,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
@@ -4751,7 +4793,7 @@ index 69d6de6e9618dd27f5ba73b931f8455912caf060..77f0e0a9e991f65b89909d0307fd93c3
@NotNull
String getDisplayName();
-@@ -60,7 +80,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
@@ -4761,7 +4803,7 @@ index 69d6de6e9618dd27f5ba73b931f8455912caf060..77f0e0a9e991f65b89909d0307fd93c3
void setDisplayName(@Nullable String name);
/**
-@@ -73,6 +95,32 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
+@@ -73,6 +130,32 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
*/
boolean hasItemName();
@@ -4794,7 +4836,7 @@ index 69d6de6e9618dd27f5ba73b931f8455912caf060..77f0e0a9e991f65b89909d0307fd93c3
/**
* Gets the item name that is set.
*
-@@ -83,7 +131,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
@@ -4804,7 +4846,7 @@ index 69d6de6e9618dd27f5ba73b931f8455912caf060..77f0e0a9e991f65b89909d0307fd93c3
@NotNull
String getItemName();
-@@ -94,7 +144,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
@@ -4814,7 +4856,7 @@ index 69d6de6e9618dd27f5ba73b931f8455912caf060..77f0e0a9e991f65b89909d0307fd93c3
void setItemName(@Nullable String name);
/**
-@@ -135,6 +187,24 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
+@@ -135,6 +222,24 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
*/
boolean hasLore();
@@ -4839,7 +4881,7 @@ index 69d6de6e9618dd27f5ba73b931f8455912caf060..77f0e0a9e991f65b89909d0307fd93c3
/**
* Gets the lore that is set.
*
-@@ -142,7 +212,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
@@ -4849,7 +4891,7 @@ index 69d6de6e9618dd27f5ba73b931f8455912caf060..77f0e0a9e991f65b89909d0307fd93c3
@Nullable
List
+- * Plugins should check that hasCustomName() returns
++ * Plugins should check that {@link #hasCustomPotionName()} returns {@code true}
++ * before calling this method.
++ *
++ * @return the potion name that is set
++ */
++ @Nullable
++ String getCustomPotionName();
++
++ /**
++ * Sets the potion name translation suffix.
++ *
++ * @param name the name to set
++ */
++ void setCustomPotionName(@Nullable String name);
+
+ @Override
+ PotionMeta clone();
diff --git a/src/main/java/org/bukkit/inventory/meta/WritableBookMeta.java b/src/main/java/org/bukkit/inventory/meta/WritableBookMeta.java
index 12595536080ffe09df2b6ecdb83d846f50100d38..9fc47c879ee6b8edf2503f20e4736c2997d2de2e 100644
--- a/src/main/java/org/bukkit/inventory/meta/WritableBookMeta.java
diff --git a/patches/api/0053-Fix-upstream-javadocs.patch b/patches/api/0053-Fix-upstream-javadocs.patch
index a18698396f..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 77f0e0a9e991f65b89909d0307fd93c3ecd9d8ac..66315ae78d6143ac6bde2b3a2b40b617dc4b1aab 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
-@@ -293,7 +293,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 77f0e0a9e991f65b89909d0307fd93c3ecd9d8ac..66315ae78d6143ac6bde2b3a2b40b617
*/
int getEnchantable();
-@@ -626,11 +626,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 77f0e0a9e991f65b89909d0307fd93c3ecd9d8ac..66315ae78d6143ac6bde2b3a2b40b617
*
* @return remainder
*/
-@@ -767,7 +762,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 77f0e0a9e991f65b89909d0307fd93c3ecd9d8ac..66315ae78d6143ac6bde2b3a2b40b617
* to apply the changes.
*
* @return component
-@@ -776,7 +771,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 77f0e0a9e991f65b89909d0307fd93c3ecd9d8ac..66315ae78d6143ac6bde2b3a2b40b617
*
* @param jukeboxPlayable new component
*/
-@@ -803,7 +798,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}.true
++ * Plugins should check that {@link #hasCustomPotionName()} returns {@code true}
+ * before calling this method.
+ *
++ * @deprecated conflicting name, use {@link #getCustomPotionName()}
+ * @return the potion name that is set
+ */
++ @Deprecated(forRemoval = true, since = "1.21.4")
+ @Nullable
+- String getCustomName();
++ default String getCustomName() {
++ return this.getCustomPotionName();
++ }
+
+ /**
+ * Sets the potion name translation suffix.
+ *
++ * @deprecated conflicting name, use {@link #setCustomPotionName(String)}
+ * @param name the name to set
+ */
+- void setCustomName(@Nullable String name);
++ @Deprecated(forRemoval = true, since = "1.21.4")
++ default void setCustomName(@Nullable String name) {
++ this.setCustomPotionName(name);
++ }
++
++ /**
++ * Checks for existence of a custom potion name translation suffix.
++ *
++ * @return true if this has a custom potion name
++ */
++ boolean hasCustomPotionName();
++
++ /**
++ * Gets the potion name translation suffix that is set.
++ *
diff --git a/patches/api/0166-Fix-Spigot-annotation-mistakes.patch b/patches/api/0166-Fix-Spigot-annotation-mistakes.patch
index 03b04b5bf8..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 66315ae78d6143ac6bde2b3a2b40b617dc4b1aab..b770541429649cefed3f7f907cc1d9653e395937 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
-@@ -152,6 +152,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 66315ae78d6143ac6bde2b3a2b40b617dc4b1aab..b770541429649cefed3f7f907cc1d965
* @return true if this has a localized name
* @deprecated meta no longer exists
*/
-@@ -164,6 +165,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 66315ae78d6143ac6bde2b3a2b40b617dc4b1aab..b770541429649cefed3f7f907cc1d965
* @return the localized name that is set
* @deprecated meta no longer exists
*/
-@@ -174,6 +176,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 66315ae78d6143ac6bde2b3a2b40b617dc4b1aab..b770541429649cefed3f7f907cc1d965
* @param name the name to set
* @deprecated meta no longer exists
*/
-@@ -767,7 +770,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 3bdc7615ad..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 eb14949da2b96aee75e3bba63af8176c5550a380..0151a0523069b00a1cf682ad6b54142aaffcfaa6 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 eb14949da2b96aee75e3bba63af8176c5550a380..0151a0523069b00a1cf682ad6b54142a
import org.bukkit.NamespacedKey;
import org.bukkit.Tag;
import org.bukkit.attribute.Attribute;
-@@ -76,6 +77,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 eb14949da2b96aee75e3bba63af8176c5550a380..0151a0523069b00a1cf682ad6b54142a
/**
* Sets the display name.
*
-@@ -85,6 +100,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 eb14949da2b96aee75e3bba63af8176c5550a380..0151a0523069b00a1cf682ad6b54142a
/**
* Checks for existence of an item name.
*
-@@ -221,6 +246,19 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
+@@ -256,6 +281,19 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
@Nullable
List