2013-07-11 01:31:30 +00:00
|
|
|
From 4cf48c39d3d68b3e7c64809909d03a3e1acea22b Mon Sep 17 00:00:00 2001
|
2013-07-05 02:17:22 +00:00
|
|
|
From: Jim Bilbrey <jb_aero@verizon.net>
|
|
|
|
Date: Wed, 19 Jun 2013 05:38:05 -0400
|
|
|
|
Subject: [PATCH] Define Ambient Setting of Potion Effects
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
2013-07-09 03:16:16 +00:00
|
|
|
index 3db1b22..443dde9 100644
|
2013-07-05 02:17:22 +00:00
|
|
|
--- 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;
|
|
|
|
}
|
|
|
|
--
|
|
|
|
1.8.1.2
|
|
|
|
|