mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-30 06:24:06 +01:00
SPIGOT-5591: Allow concurrent potion effects
This commit is contained in:
parent
25a9a9ff62
commit
d5ef2eab9e
@ -321,12 +321,6 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean addPotionEffect(PotionEffect effect, boolean force) {
|
public boolean addPotionEffect(PotionEffect effect, boolean force) {
|
||||||
if (hasPotionEffect(effect.getType())) {
|
|
||||||
if (!force) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
removePotionEffect(effect.getType());
|
|
||||||
}
|
|
||||||
getHandle().addEffect(new MobEffect(MobEffectList.fromId(effect.getType().getId()), effect.getDuration(), effect.getAmplifier(), effect.isAmbient(), effect.hasParticles()), EntityPotionEffectEvent.Cause.PLUGIN);
|
getHandle().addEffect(new MobEffect(MobEffectList.fromId(effect.getType().getId()), effect.getDuration(), effect.getAmplifier(), effect.isAmbient(), effect.hasParticles()), EntityPotionEffectEvent.Cause.PLUGIN);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user