|
| 1 | +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Nassim Jahnke < [email protected]> |
| 3 | +Date: Mon, 23 Dec 2024 19:53:19 +0100 |
| 4 | +Subject: [PATCH] Fix dumb PotionMeta names |
| 5 | + |
| 6 | + |
| 7 | +diff --git a/src/main/java/org/bukkit/inventory/meta/PotionMeta.java b/src/main/java/org/bukkit/inventory/meta/PotionMeta.java |
| 8 | +index b61d2e322f80fcabae5e286cba8df9701ebcf5ea..355257ae899dc5d90965295ecb8cf8fe888ce9f0 100644 |
| 9 | +--- a/src/main/java/org/bukkit/inventory/meta/PotionMeta.java |
| 10 | ++++ b/src/main/java/org/bukkit/inventory/meta/PotionMeta.java |
| 11 | +@@ -146,30 +146,69 @@ public interface PotionMeta extends ItemMeta { |
| 12 | + */ |
| 13 | + void setColor(@Nullable Color color); |
| 14 | + |
| 15 | ++ // Paper start - fix dumb names |
| 16 | + /** |
| 17 | + * Checks for existence of a custom potion name translation suffix. |
| 18 | + * |
| 19 | ++ * @deprecated conflicting name, use {@link #hasCustomPotionName()} |
| 20 | + * @return true if this has a custom potion name |
| 21 | + */ |
| 22 | +- boolean hasCustomName(); |
| 23 | ++ @Deprecated(forRemoval = true) |
| 24 | ++ default boolean hasCustomName() { |
| 25 | ++ return this.hasCustomPotionName(); |
| 26 | ++ } |
| 27 | + |
| 28 | + /** |
| 29 | + * Gets the potion name translation suffix that is set. |
| 30 | + * <p> |
| 31 | +- * Plugins should check that hasCustomName() returns <code>true</code> |
| 32 | ++ * Plugins should check that {@link #hasCustomPotionName()} returns {@code true} |
| 33 | + * before calling this method. |
| 34 | + * |
| 35 | ++ * @deprecated conflicting name, use {@link #getCustomPotionName()} |
| 36 | + * @return the potion name that is set |
| 37 | + */ |
| 38 | ++ @Deprecated(forRemoval = true) |
| 39 | + @Nullable |
| 40 | +- String getCustomName(); |
| 41 | ++ default String getCustomName() { |
| 42 | ++ return this.getCustomPotionName(); |
| 43 | ++ } |
| 44 | + |
| 45 | + /** |
| 46 | + * Sets the potion name translation suffix. |
| 47 | + * |
| 48 | ++ * @deprecated conflicting name, use {@link #setCustomPotionName(String)} |
| 49 | + * @param name the name to set |
| 50 | + */ |
| 51 | +- void setCustomName(@Nullable String name); |
| 52 | ++ @Deprecated(forRemoval = true) |
| 53 | ++ default void setCustomName(@Nullable String name) { |
| 54 | ++ this.setCustomPotionName(name); |
| 55 | ++ } |
| 56 | ++ |
| 57 | ++ /** |
| 58 | ++ * Checks for existence of a custom potion name translation suffix. |
| 59 | ++ * |
| 60 | ++ * @return true if this has a custom potion name |
| 61 | ++ */ |
| 62 | ++ boolean hasCustomPotionName(); |
| 63 | ++ |
| 64 | ++ /** |
| 65 | ++ * Gets the potion name translation suffix that is set. |
| 66 | ++ * <p> |
| 67 | ++ * Plugins should check that {@link #hasCustomPotionName()} returns {@code true} |
| 68 | ++ * before calling this method. |
| 69 | ++ * |
| 70 | ++ * @return the potion name that is set |
| 71 | ++ */ |
| 72 | ++ @Nullable |
| 73 | ++ String getCustomPotionName(); |
| 74 | ++ |
| 75 | ++ /** |
| 76 | ++ * Sets the potion name translation suffix. |
| 77 | ++ * |
| 78 | ++ * @param name the name to set |
| 79 | ++ */ |
| 80 | ++ void setCustomPotionName(@Nullable String name); |
| 81 | ++ // Paper end - fix dumb names |
| 82 | + |
| 83 | + @Override |
| 84 | + PotionMeta clone(); |
0 commit comments