From 55fa63e8b9c8f5f315f3d631fad2096a008074df Mon Sep 17 00:00:00 2001 From: Lukas Hennig Date: Fri, 16 Dec 2016 17:21:43 +0100 Subject: SPIGOT-2923: Added PotionEffectType#getColor() --- src/main/java/org/bukkit/potion/PotionEffectType.java | 8 ++++++++ src/main/java/org/bukkit/potion/PotionEffectTypeWrapper.java | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/src/main/java/org/bukkit/potion/PotionEffectType.java b/src/main/java/org/bukkit/potion/PotionEffectType.java index 27c1f47c..b7c068b5 100644 --- a/src/main/java/org/bukkit/potion/PotionEffectType.java +++ b/src/main/java/org/bukkit/potion/PotionEffectType.java @@ -4,6 +4,7 @@ import java.util.HashMap; import java.util.Map; import org.apache.commons.lang.Validate; +import org.bukkit.Color; /** * Represents a type of potion and its effect on an entity. @@ -197,6 +198,13 @@ public abstract class PotionEffectType { */ public abstract boolean isInstant(); + /** + * Returns the color of this effect type. + * + * @return the color + */ + public abstract Color getColor(); + @Override public boolean equals(Object obj) { if (obj == null) { diff --git a/src/main/java/org/bukkit/potion/PotionEffectTypeWrapper.java b/src/main/java/org/bukkit/potion/PotionEffectTypeWrapper.java index 5db1ce85..356a866f 100644 --- a/src/main/java/org/bukkit/potion/PotionEffectTypeWrapper.java +++ b/src/main/java/org/bukkit/potion/PotionEffectTypeWrapper.java @@ -1,5 +1,7 @@ package org.bukkit.potion; +import org.bukkit.Color; + public class PotionEffectTypeWrapper extends PotionEffectType { protected PotionEffectTypeWrapper(int id) { super(id); @@ -28,4 +30,9 @@ public class PotionEffectTypeWrapper extends PotionEffectType { public boolean isInstant() { return getType().isInstant(); } + + @Override + public Color getColor() { + return getType().getColor(); + } } -- cgit v1.2.3