Deprecated potioneffect to potioneffecttype as they don't expire naturally.

This commit is contained in:
Andrew 2013-11-06 21:05:35 +13:00
parent 62cd0f2832
commit 3c5c3c958a

View File

@ -18,10 +18,18 @@ public class LivingWatcher extends FlagWatcher {
super(disguise); super(disguise);
} }
@Deprecated
public void addPotionEffect(PotionEffect potionEffect) { public void addPotionEffect(PotionEffect potionEffect) {
if (hasPotionEffect(potionEffect.getType())) if (hasPotionEffect(potionEffect.getType()))
removePotionEffect(potionEffect.getType()); removePotionEffect(potionEffect.getType());
new MobEffect(potionEffect.getType().getId(), potionEffect.getDuration(), potionEffect.getAmplifier()); potionEffects.add(new MobEffect(potionEffect.getType().getId(), potionEffect.getDuration(), potionEffect.getAmplifier()));
sendPotionEffects();
}
public void addPotionEffect(PotionEffectType potionEffect) {
if (hasPotionEffect(potionEffect))
removePotionEffect(potionEffect);
potionEffects.add(new MobEffect(potionEffect.getId(), 0, 0));
sendPotionEffects(); sendPotionEffects();
} }