From e43b2780a5d627a844ee19e8adc937bf6ddd40d0 Mon Sep 17 00:00:00 2001 From: Matthew Date: Sun, 13 Mar 2016 17:39:44 -0400 Subject: [PATCH] SPIGOT-1914: Compare PotionEffectType objects using Object#equals(Object) when searching for a custom effect to remove --- .../java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java index 50612a91a1..569a92d319 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java @@ -205,7 +205,7 @@ class CraftMetaPotion extends CraftMetaItem implements PotionMeta { Iterator iterator = customEffects.iterator(); while (iterator.hasNext()) { PotionEffect effect = iterator.next(); - if (effect.getType() == type) { + if (type.equals(effect.getType())) { iterator.remove(); changed = true; }