summaryrefslogtreecommitdiffstats
path: root/src/main/java/org
diff options
context:
space:
mode:
authorTravis Watkins <amaranth@ubuntu.com>2012-04-24 18:59:55 -0500
committerEvilSeph <evilseph@gmail.com>2012-04-24 21:58:35 -0400
commit73ae279e8d7d463b066a3b2fe68f82f9b45a93e9 (patch)
tree1297ef09d2d4a338cdb9daf434a77718aa6262d6 /src/main/java/org
parente98cfbd992abad36688b2f9b282154c93e3c8ede (diff)
downloadcraftbukkit-73ae279e8d7d463b066a3b2fe68f82f9b45a93e9.tar
craftbukkit-73ae279e8d7d463b066a3b2fe68f82f9b45a93e9.tar.gz
craftbukkit-73ae279e8d7d463b066a3b2fe68f82f9b45a93e9.tar.lz
craftbukkit-73ae279e8d7d463b066a3b2fe68f82f9b45a93e9.tar.xz
craftbukkit-73ae279e8d7d463b066a3b2fe68f82f9b45a93e9.zip
Update players when potion effects are moved from them. Fixes BUKKIT-789
Diffstat (limited to 'src/main/java/org')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index c8a413a4..4d071841 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -17,6 +17,7 @@ import net.minecraft.server.EntitySnowball;
import net.minecraft.server.EntityPlayer;
import net.minecraft.server.MobEffect;
import net.minecraft.server.MobEffectList;
+import net.minecraft.server.Packet42RemoveMobEffect;
import org.bukkit.Location;
import org.bukkit.block.Block;
@@ -237,6 +238,10 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
public void removePotionEffect(PotionEffectType type) {
getHandle().effects.remove(type.getId());
+ getHandle().e = true; // Should be called updateEffects
+ if (getHandle() instanceof EntityPlayer) {
+ ((EntityPlayer)getHandle()).netServerHandler.sendPacket(new Packet42RemoveMobEffect(getHandle().id, new MobEffect(type.getId(), 0, 0)));
+ }
}
public Collection<PotionEffect> getActivePotionEffects() {