From 73ae279e8d7d463b066a3b2fe68f82f9b45a93e9 Mon Sep 17 00:00:00 2001 From: Travis Watkins Date: Tue, 24 Apr 2012 18:59:55 -0500 Subject: [PATCH] Update players when potion effects are moved from them. Fixes BUKKIT-789 --- src/main/java/net/minecraft/server/EntityLiving.java | 2 +- .../org/bukkit/craftbukkit/entity/CraftLivingEntity.java | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java index 83933467ce..ea1fd3e7ff 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -67,7 +67,7 @@ public abstract class EntityLiving extends Entity { public int aI = 0; public int aJ = 0; public HashMap effects = new HashMap(); // CraftBukkit - protected -> public - private boolean e = true; + public boolean e = true; // CraftBukkit - private -> public private int f; private ControllerLook lookController; private ControllerMove moveController; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java index c8a413a45d..4d071841fa 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 getActivePotionEffects() {