From c00db5f751bd0d96298dc17e39d8befb6dc9b29c Mon Sep 17 00:00:00 2001 From: EvilSeph Date: Wed, 3 Jul 2013 00:23:34 -0400 Subject: [PATCH] Properly clear attributes on remove and death. Fixes BUKKIT-4416 --- src/main/java/net/minecraft/server/EntityPlayer.java | 2 +- .../org/bukkit/craftbukkit/entity/CraftLivingEntity.java | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java index b38aa108f4..76f1858b50 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -914,7 +914,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.expTotal = this.newTotalExp; this.exp = 0; this.deathTicks = 0; - this.effects.clear(); + this.aG(); // Should be removeAllEffects. this.updateEffects = true; this.activeContainer = this.defaultContainer; this.killer = null; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java index da7a2af90d..1d52866e3c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -275,12 +275,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { } public void removePotionEffect(PotionEffectType type) { - getHandle().effects.remove(type.getId()); - getHandle().updateEffects = true; - if (getHandle() instanceof EntityPlayer) { - if (((EntityPlayer) getHandle()).playerConnection == null) return; - ((EntityPlayer) getHandle()).playerConnection.sendPacket(new Packet42RemoveMobEffect(getHandle().id, new MobEffect(type.getId(), 0, 0))); - } + getHandle().k(type.getId()); // Should be removeEffect. } public Collection getActivePotionEffects() {