mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-08 11:24:11 +01:00
Update players when potion effects are moved from them. Fixes BUKKIT-789
By: Travis Watkins <amaranth@ubuntu.com>
This commit is contained in:
parent
ff8b2d38f9
commit
a208a4f9e3
1 changed files with 5 additions and 0 deletions
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue