aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0006-Adventure.patch
diff options
context:
space:
mode:
authorShane Freeder <[email protected]>2024-04-28 18:08:59 +0100
committerGitHub <[email protected]>2024-04-28 10:08:59 -0700
commit52ff3b7382f1076dee9d3699fc38d4798e5a59b7 (patch)
tree786f0dbd0800cab62c6f2e242e5b98ebe6eee834 /patches/api/0006-Adventure.patch
parent0f4d328fc1e4bfff5ceb7cce0238a9baf8b03ab3 (diff)
downloadPaper-52ff3b7382f1076dee9d3699fc38d4798e5a59b7.tar.gz
Paper-52ff3b7382f1076dee9d3699fc38d4798e5a59b7.zip
Add itemName components (Resolves #10467) (#10471)
* Add itemName components (Resolves ##10467) * improve javadocs and formatting * rebased --------- Co-authored-by: Jake Potrebic <[email protected]>
Diffstat (limited to 'patches/api/0006-Adventure.patch')
-rw-r--r--patches/api/0006-Adventure.patch61
1 files changed, 57 insertions, 4 deletions
diff --git a/patches/api/0006-Adventure.patch b/patches/api/0006-Adventure.patch
index e991609a01..26674a6554 100644
--- a/patches/api/0006-Adventure.patch
+++ b/patches/api/0006-Adventure.patch
@@ -4596,7 +4596,7 @@ 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 255f79d5bca15620cb17d7b54ffebb6ff00bff6b..d7c178b3584db5866a5a21c6ddaab876b94058b9 100644
+index 255f79d5bca15620cb17d7b54ffebb6ff00bff6b..18c2864c99d4dfae16cdb35143486aeebb9a6fd6 100644
--- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
+++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
@@ -34,6 +34,24 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
@@ -4644,7 +4644,60 @@ index 255f79d5bca15620cb17d7b54ffebb6ff00bff6b..d7c178b3584db5866a5a21c6ddaab876
void setDisplayName(@Nullable String name);
/**
-@@ -124,6 +146,24 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
+@@ -62,6 +84,32 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
+ */
+ boolean hasItemName();
+
++ // Paper start
++ /**
++ * Gets the item name component that is set.
++ * <br>
++ * Item name differs from display name in that it is cannot be edited by an
++ * anvil, is not styled with italics, and does not show labels.
++ * <p>
++ * Plugins should check that {@link #hasItemName()} returns <code>true</code> before
++ * calling this method.
++ *
++ * @return the item name that is set
++ * @see #hasItemName()
++ */
++ @org.jetbrains.annotations.NotNull
++ Component itemName();
++
++ /**
++ * Sets the item name.
++ * <br>
++ * Item name differs from display name in that it is cannot be edited by an
++ * anvil, is not styled with italics, and does not show labels.
++ *
++ * @param name the name to set, null to remove it
++ */
++ void itemName(@Nullable final Component name);
++ // Paper end
+ /**
+ * Gets the item name that is set.
+ * <br>
+@@ -72,7 +120,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
+ * calling this method.
+ *
+ * @return the item name that is set
++ * @deprecated in favour of {@link #itemName()}
+ */
++ @Deprecated // Paper
+ @NotNull
+ String getItemName();
+
+@@ -83,7 +133,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
++ * @deprecated in favour of {@link #itemName(Component)}
+ */
++ @Deprecated // Paper
+ void setItemName(@Nullable String name);
+
+ /**
+@@ -124,6 +176,24 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
*/
boolean hasLore();
@@ -4669,7 +4722,7 @@ index 255f79d5bca15620cb17d7b54ffebb6ff00bff6b..d7c178b3584db5866a5a21c6ddaab876
/**
* Gets the lore that is set.
* <p>
-@@ -131,7 +171,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
+@@ -131,7 +201,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
* calling this method.
*
* @return a list of lore that is set
@@ -4679,7 +4732,7 @@ index 255f79d5bca15620cb17d7b54ffebb6ff00bff6b..d7c178b3584db5866a5a21c6ddaab876
@Nullable
List<String> getLore();
-@@ -140,7 +182,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
+@@ -140,7 +212,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
* Removes lore when given null.
*
* @param lore the lore that will be set