From 77cd4eb79a8e16a8ed9907eba85cf701f5e118b5 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Fri, 18 Nov 2016 09:49:31 +1100 Subject: [PATCH] SPIGOT-2782: Custom Colors for Potions By: md_5 --- .../org/bukkit/inventory/meta/PotionMeta.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/inventory/meta/PotionMeta.java b/paper-api/src/main/java/org/bukkit/inventory/meta/PotionMeta.java index 2be09e2efa..d9151259f6 100644 --- a/paper-api/src/main/java/org/bukkit/inventory/meta/PotionMeta.java +++ b/paper-api/src/main/java/org/bukkit/inventory/meta/PotionMeta.java @@ -1,5 +1,6 @@ package org.bukkit.inventory.meta; +import org.bukkit.Color; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.bukkit.potion.PotionData; @@ -89,6 +90,32 @@ public interface PotionMeta extends ItemMeta { */ boolean clearCustomEffects(); + /** + * Checks for existence of a potion color. + * + * @return true if this has a custom potion color + */ + boolean hasColor(); + + /** + * Gets the potion color that is set. A custom potion color will alter the + * display of the potion in an inventory slot. + *

+ * Plugins should check that hasColor() returns true before + * calling this method. + * + * @return the potion color that is set + */ + Color getColor(); + + /** + * Sets the potion color. A custom potion color will alter the display of + * the potion in an inventory slot. + * + * @param color the color to set + */ + void setColor(Color color); + @Override PotionMeta clone(); }