diff options
author | Jim Bilbrey <jb_aero@verizon.net> | 2013-06-19 05:38:05 -0400 |
---|---|---|
committer | h31ix <zero_gravity@outlook.com> | 2013-07-13 20:28:16 -0400 |
commit | 4ad3cdd4b5cfe90f319cfba6c4dabc9bff10a59d (patch) | |
tree | 755dba92385194fedb5b3070c6ab6f37cd1a027c /src/main/java/org/bukkit | |
parent | cebc247b78e14c7bc236d69010e1000d53be28ef (diff) | |
download | craftbukkit-4ad3cdd4b5cfe90f319cfba6c4dabc9bff10a59d.tar craftbukkit-4ad3cdd4b5cfe90f319cfba6c4dabc9bff10a59d.tar.gz craftbukkit-4ad3cdd4b5cfe90f319cfba6c4dabc9bff10a59d.tar.lz craftbukkit-4ad3cdd4b5cfe90f319cfba6c4dabc9bff10a59d.tar.xz craftbukkit-4ad3cdd4b5cfe90f319cfba6c4dabc9bff10a59d.zip |
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.
Diffstat (limited to 'src/main/java/org/bukkit')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java index 3db1b223..443dde91 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -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; } |