Readd reverted EntityLiving patch

This commit is contained in:
LexManos 2012-09-15 19:40:58 -07:00
parent 04c149fa11
commit 8948a00d60

View file

@ -142,3 +142,34 @@
}
/**
@@ -2180,4 +2228,30 @@
this.worldObj.spawnParticle("iconcrack_" + par1ItemStack.getItem().shiftedIndex, var4.xCoord, var4.yCoord, var4.zCoord, var3.xCoord, var3.yCoord + 0.05D, var3.zCoord);
}
}
+
+ /***
+ * Removes all potion effects that have curativeItem as a curative item for its effect
+ * @param curativeItem The itemstack we are using to cure potion effects
+ */
+ public void curePotionEffects(ItemStack curativeItem)
+ {
+ Iterator<Integer> potionKey = activePotionsMap.keySet().iterator();
+
+ if (worldObj.isRemote)
+ {
+ return;
+ }
+
+ while (potionKey.hasNext())
+ {
+ Integer key = potionKey.next();
+ PotionEffect effect = (PotionEffect)activePotionsMap.get(key);
+
+ if (effect.isCurativeItem(curativeItem))
+ {
+ potionKey.remove();
+ onFinishedPotionEffect(effect);
+ }
+ }
+ }
}