Commits

md_5 authored 84845e07fe6
SPIGOT-2782: Custom Colors for Potions
No tags

src/main/java/org/bukkit/inventory/meta/PotionMeta.java

Modified
1 1 package org.bukkit.inventory.meta;
2 2
3 +import org.bukkit.Color;
3 4 import org.bukkit.potion.PotionEffect;
4 5 import org.bukkit.potion.PotionEffectType;
5 6 import org.bukkit.potion.PotionData;
6 7 import org.bukkit.potion.PotionType;
7 8
8 9 import java.util.List;
9 10
10 11 /**
11 12 * Represents a potion or item that can have custom effects.
12 13 */
82 83 @Deprecated
83 84 boolean setMainEffect(PotionEffectType type);
84 85
85 86 /**
86 87 * Removes all custom potion effects from this potion.
87 88 *
88 89 * @return true if the potion meta changed as a result of this call
89 90 */
90 91 boolean clearCustomEffects();
91 92
93 + /**
94 + * Checks for existence of a potion color.
95 + *
96 + * @return true if this has a custom potion color
97 + */
98 + boolean hasColor();
99 +
100 + /**
101 + * Gets the potion color that is set. A custom potion color will alter the
102 + * display of the potion in an inventory slot.
103 + * <p>
104 + * Plugins should check that hasColor() returns <code>true</code> before
105 + * calling this method.
106 + *
107 + * @return the potion color that is set
108 + */
109 + Color getColor();
110 +
111 + /**
112 + * Sets the potion color. A custom potion color will alter the display of
113 + * the potion in an inventory slot.
114 + *
115 + * @param color the color to set
116 + */
117 + void setColor(Color color);
118 +
92 119 @Override
93 120 PotionMeta clone();
94 121 }

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut