mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-23 08:46:44 +01:00
Use ambient setting of potion effects. Fixes BUKKIT-4357 and BUKKIT-3653
This changes livingEntity.addPotionEffect(PotionEffect, boolean) to construct the MobEffect using the constructor that includes the ambient setting as supplied by the PotionEffect This also changes livingEntity.getActivePotionEffects() to construct the PotionEffects using the ambient setting supplied by the MobEffects. By: Jim Bilbrey <jb_aero@verizon.net>
This commit is contained in:
parent
5bd02e83f2
commit
701de44fd3
1 changed files with 2 additions and 2 deletions
|
@ -258,7 +258,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
|||
}
|
||||
removePotionEffect(effect.getType());
|
||||
}
|
||||
getHandle().addEffect(new MobEffect(effect.getType().getId(), effect.getDuration(), effect.getAmplifier()));
|
||||
getHandle().addEffect(new MobEffect(effect.getType().getId(), effect.getDuration(), effect.getAmplifier(), effect.isAmbient()));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -284,7 +284,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
|||
if (!(raw instanceof MobEffect))
|
||||
continue;
|
||||
MobEffect handle = (MobEffect) raw;
|
||||
effects.add(new PotionEffect(PotionEffectType.getById(handle.getEffectId()), handle.getDuration(), handle.getAmplifier()));
|
||||
effects.add(new PotionEffect(PotionEffectType.getById(handle.getEffectId()), handle.getDuration(), handle.getAmplifier(), handle.isAmbient()));
|
||||
}
|
||||
return effects;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue