From 7b3869e385ed0bff576132482ea4eb926fc723fc Mon Sep 17 00:00:00 2001 From: GJ Date: Mon, 3 Mar 2014 09:24:24 -0500 Subject: [PATCH] Use .equals instead of deprecated ID method. --- .../java/com/gmail/nossr50/listeners/EntityListener.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java index be3abf704..6094c1395 100644 --- a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java @@ -56,6 +56,7 @@ import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.player.UserManager; import com.gmail.nossr50.util.skills.CombatUtils; import com.gmail.nossr50.util.skills.SkillUtils; +import org.bukkit.potion.PotionEffectType; public class EntityListener implements Listener { private final mcMMO plugin; @@ -614,9 +615,8 @@ public class EntityListener implements Listener { */ @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onPotionSplash(PotionSplashEvent event) { - for (PotionEffect effect : ((PotionMeta) event.getEntity().getItem().getItemMeta()).getCustomEffects()) { - // (effect.getType() != PotionEffectType.SATURATION) is seemingly broken, so we use deprecated method for now. - if (effect.getType().getId() != 23) { + for (PotionEffect effect : ((PotionMeta) event.getPotion().getItem().getItemMeta()).getCustomEffects()) { + if (!effect.getType().equals(PotionEffectType.SATURATION)) { return; }