* Add itemName components (Resolves ##10467) * improve javadocs and formatting * rebased --------- Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
This commit is contained in:
parent
0f4d328fc1
commit
52ff3b7382
12 changed files with 112 additions and 40 deletions
|
@ -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
|
||||
|
|
|
@ -1438,10 +1438,10 @@ index 07c3dff4d6190ef388d9c1e1c36f67f00a3e8e66..597a18a767b68b47e81454b7d44613c7
|
|||
* @param input The input choice.
|
||||
* @return The changed recipe, so you can chain calls.
|
||||
diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
|
||||
index d7c178b3584db5866a5a21c6ddaab876b94058b9..dff32cedf47e95fe14a865898d76b62748dee5f3 100644
|
||||
index 18c2864c99d4dfae16cdb35143486aeebb9a6fd6..d66857825528ee772219440dffa28ad8e820493b 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
|
||||
@@ -483,7 +483,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
|
||||
@@ -513,7 +513,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}.<br>
|
||||
|
|
|
@ -1587,10 +1587,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 dff32cedf47e95fe14a865898d76b62748dee5f3..05a57b42e874c6e50149aa253861abaf5e17cef0 100644
|
||||
index d66857825528ee772219440dffa28ad8e820493b..3ddd52b135f339ff006b5d53f46487bfbe1ff7fd 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
|
||||
@@ -111,6 +111,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
|
||||
@@ -141,6 +141,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
|
||||
/**
|
||||
* Checks for existence of a localized name.
|
||||
*
|
||||
|
@ -1598,7 +1598,7 @@ index dff32cedf47e95fe14a865898d76b62748dee5f3..05a57b42e874c6e50149aa253861abaf
|
|||
* @return true if this has a localized name
|
||||
* @deprecated meta no longer exists
|
||||
*/
|
||||
@@ -123,6 +124,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
|
||||
@@ -153,6 +154,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
|
||||
* Plugins should check that hasLocalizedName() returns <code>true</code>
|
||||
* before calling this method.
|
||||
*
|
||||
|
@ -1606,7 +1606,7 @@ index dff32cedf47e95fe14a865898d76b62748dee5f3..05a57b42e874c6e50149aa253861abaf
|
|||
* @return the localized name that is set
|
||||
* @deprecated meta no longer exists
|
||||
*/
|
||||
@@ -133,6 +135,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
|
||||
@@ -163,6 +165,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
|
||||
/**
|
||||
* Sets the localized name.
|
||||
*
|
||||
|
|
|
@ -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 05a57b42e874c6e50149aa253861abaf5e17cef0..ab69711ebd81fb512c7abebc5b439e89a4754bd2 100644
|
||||
index 3ddd52b135f339ff006b5d53f46487bfbe1ff7fd..ed12e27a0ed75caa8aa46c3e965ed566a97865cf 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;
|
||||
|
@ -54,7 +54,7 @@ index 05a57b42e874c6e50149aa253861abaf5e17cef0..ab69711ebd81fb512c7abebc5b439e89
|
|||
/**
|
||||
* Checks for existence of an item name.
|
||||
* <br>
|
||||
@@ -180,6 +205,19 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
|
||||
@@ -210,6 +235,19 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
|
||||
@Nullable
|
||||
List<String> getLore();
|
||||
|
||||
|
@ -74,7 +74,7 @@ index 05a57b42e874c6e50149aa253861abaf5e17cef0..ab69711ebd81fb512c7abebc5b439e89
|
|||
/**
|
||||
* Sets the lore for this item.
|
||||
* Removes lore when given null.
|
||||
@@ -190,6 +228,16 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
|
||||
@@ -220,6 +258,16 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
|
||||
@Deprecated // Paper
|
||||
void setLore(@Nullable List<String> lore);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue