diff options
author | Jake Potrebic <[email protected]> | 2024-04-28 08:31:06 -0700 |
---|---|---|
committer | Jake Potrebic <[email protected]> | 2024-04-28 09:48:32 -0700 |
commit | 08ba0df20460546a1a8c18c200dfc0ccdb90387a (patch) | |
tree | a3b4be388495286856d89fc4a0f170c2e2341b93 | |
parent | 50864da7bb3d31d5cd5f2c8188e14c54001de976 (diff) | |
download | Paper-08ba0df20460546a1a8c18c200dfc0ccdb90387a.tar.gz Paper-08ba0df20460546a1a8c18c200dfc0ccdb90387a.zip |
improve javadocs and formatting
-rw-r--r-- | patches/api/0006-Adventure.patch | 52 | ||||
-rw-r--r-- | patches/api/0056-Fix-upstream-javadocs.patch | 4 | ||||
-rw-r--r-- | patches/api/0172-Fix-Spigot-annotation-mistakes.patch | 8 | ||||
-rw-r--r-- | patches/api/0200-Support-components-in-ItemMeta.patch | 6 | ||||
-rw-r--r-- | patches/server/0010-Adventure.patch | 6 |
5 files changed, 39 insertions, 37 deletions
diff --git a/patches/api/0006-Adventure.patch b/patches/api/0006-Adventure.patch index 3e6bd53c7f..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..ee9fe9a1f4829768ac3a508eabb11fce0addbc60 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,18 +4644,23 @@ index 255f79d5bca15620cb17d7b54ffebb6ff00bff6b..ee9fe9a1f4829768ac3a508eabb11fce void setDisplayName(@Nullable String name); /** -@@ -62,6 +84,7 @@ 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 that is set. - * <br> -@@ -73,6 +96,32 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste - * - * @return the item name that is set - */ ++ /** ++ * 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(); + @@ -4665,27 +4670,24 @@ index 255f79d5bca15620cb17d7b54ffebb6ff00bff6b..ee9fe9a1f4829768ac3a508eabb11fce + * 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 ++ * @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> -+ * 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 hasItemName() returns <code>true</code> before -+ * calling this method. -+ * -+ * @return the item name that is set + /** + * 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 +132,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste +@@ -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 @@ -4695,7 +4697,7 @@ index 255f79d5bca15620cb17d7b54ffebb6ff00bff6b..ee9fe9a1f4829768ac3a508eabb11fce void setItemName(@Nullable String name); /** -@@ -124,6 +175,24 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste +@@ -124,6 +176,24 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste */ boolean hasLore(); @@ -4720,7 +4722,7 @@ index 255f79d5bca15620cb17d7b54ffebb6ff00bff6b..ee9fe9a1f4829768ac3a508eabb11fce /** * Gets the lore that is set. * <p> -@@ -131,7 +200,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 @@ -4730,7 +4732,7 @@ index 255f79d5bca15620cb17d7b54ffebb6ff00bff6b..ee9fe9a1f4829768ac3a508eabb11fce @Nullable List<String> getLore(); -@@ -140,7 +211,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 diff --git a/patches/api/0056-Fix-upstream-javadocs.patch b/patches/api/0056-Fix-upstream-javadocs.patch index c5b3f38175..1aa0e45854 100644 --- a/patches/api/0056-Fix-upstream-javadocs.patch +++ b/patches/api/0056-Fix-upstream-javadocs.patch @@ -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 ee9fe9a1f4829768ac3a508eabb11fce0addbc60..75181a4c93347fcdb284bf5d1c4963c9a9f38848 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 -@@ -512,7 +512,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> diff --git a/patches/api/0172-Fix-Spigot-annotation-mistakes.patch b/patches/api/0172-Fix-Spigot-annotation-mistakes.patch index 546bc10911..6dc3d96c0b 100644 --- a/patches/api/0172-Fix-Spigot-annotation-mistakes.patch +++ b/patches/api/0172-Fix-Spigot-annotation-mistakes.patch @@ -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 75181a4c93347fcdb284bf5d1c4963c9a9f38848..b54d2fa93460e12051945a1e24dc713dfe4642eb 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 -@@ -140,6 +140,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 75181a4c93347fcdb284bf5d1c4963c9a9f38848..b54d2fa93460e12051945a1e24dc713d * @return true if this has a localized name * @deprecated meta no longer exists */ -@@ -152,6 +153,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 75181a4c93347fcdb284bf5d1c4963c9a9f38848..b54d2fa93460e12051945a1e24dc713d * @return the localized name that is set * @deprecated meta no longer exists */ -@@ -162,6 +164,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste +@@ -163,6 +165,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste /** * Sets the localized name. * diff --git a/patches/api/0200-Support-components-in-ItemMeta.patch b/patches/api/0200-Support-components-in-ItemMeta.patch index bbff18c512..8a3122ea24 100644 --- a/patches/api/0200-Support-components-in-ItemMeta.patch +++ b/patches/api/0200-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 b54d2fa93460e12051945a1e24dc713dfe4642eb..dc17c6b6e4ee62012e4c9ef2076a9313fce0162c 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 b54d2fa93460e12051945a1e24dc713dfe4642eb..dc17c6b6e4ee62012e4c9ef2076a9313 /** * Checks for existence of an item name. * <br> -@@ -209,6 +234,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 b54d2fa93460e12051945a1e24dc713dfe4642eb..dc17c6b6e4ee62012e4c9ef2076a9313 /** * Sets the lore for this item. * Removes lore when given null. -@@ -219,6 +257,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); diff --git a/patches/server/0010-Adventure.patch b/patches/server/0010-Adventure.patch index 26bd6cef14..3ba9b0bbf2 100644 --- a/patches/server/0010-Adventure.patch +++ b/patches/server/0010-Adventure.patch @@ -5141,7 +5141,7 @@ index 9c57b883783145ad4483481a2c2e7f0f188cd174..b653c2c80e8e8524ea6d7625c6a86f82 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index 7a5110efc5af1be6644b7afecd6ac025c20e6794..780b7e971a9d4fda1a9c78790c7969a0799f51ab 100644 +index 7a5110efc5af1be6644b7afecd6ac025c20e6794..b79f29ccd512ec7d2a8f6a885c1a96dfd58e7dc5 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -843,6 +843,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -5170,12 +5170,12 @@ index 7a5110efc5af1be6644b7afecd6ac025c20e6794..780b7e971a9d4fda1a9c78790c7969a0 + // Paper start - Adventure + @Override + public net.kyori.adventure.text.Component itemName() { -+ return io.papermc.paper.adventure.PaperAdventure.asAdventure(itemName); ++ return io.papermc.paper.adventure.PaperAdventure.asAdventure(this.itemName); + } + + @Override + public void itemName(final net.kyori.adventure.text.Component name) { -+ this.itemName = name == null ? null : io.papermc.paper.adventure.PaperAdventure.asVanilla(name); ++ this.itemName = io.papermc.paper.adventure.PaperAdventure.asVanilla(name); + } + // Paper end - Adventure + |