13
0
geforkt von Mirrors/Paper

SPIGOT-2578: Method to get PotionEffect of specific type.

Dieser Commit ist enthalten in:
md_5 2016-08-07 10:53:39 +10:00
Ursprung 29e1d72893
Commit 6053c5c8ac

Datei anzeigen

@ -313,6 +313,12 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
return getHandle().hasEffect(MobEffectList.fromId(type.getId())); return getHandle().hasEffect(MobEffectList.fromId(type.getId()));
} }
@Override
public PotionEffect getPotionEffect(PotionEffectType type) {
MobEffect handle = getHandle().getEffect(MobEffectList.fromId(type.getId()));
return (handle == null) ? null : new PotionEffect(PotionEffectType.getById(MobEffectList.getId(handle.getMobEffect())), handle.getDuration(), handle.getAmplifier(), handle.isAmbient(), handle.isShowParticles());
}
public void removePotionEffect(PotionEffectType type) { public void removePotionEffect(PotionEffectType type) {
getHandle().removeEffect(MobEffectList.fromId(type.getId())); getHandle().removeEffect(MobEffectList.fromId(type.getId()));
} }