mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-21 15:54:45 +01:00
Update players when potion effects are moved from them. Fixes BUKKIT-789
This commit is contained in:
parent
e98cfbd992
commit
73ae279e8d
2 changed files with 6 additions and 1 deletions
|
@ -67,7 +67,7 @@ public abstract class EntityLiving extends Entity {
|
||||||
public int aI = 0;
|
public int aI = 0;
|
||||||
public int aJ = 0;
|
public int aJ = 0;
|
||||||
public HashMap effects = new HashMap(); // CraftBukkit - protected -> public
|
public HashMap effects = new HashMap(); // CraftBukkit - protected -> public
|
||||||
private boolean e = true;
|
public boolean e = true; // CraftBukkit - private -> public
|
||||||
private int f;
|
private int f;
|
||||||
private ControllerLook lookController;
|
private ControllerLook lookController;
|
||||||
private ControllerMove moveController;
|
private ControllerMove moveController;
|
||||||
|
|
|
@ -17,6 +17,7 @@ import net.minecraft.server.EntitySnowball;
|
||||||
import net.minecraft.server.EntityPlayer;
|
import net.minecraft.server.EntityPlayer;
|
||||||
import net.minecraft.server.MobEffect;
|
import net.minecraft.server.MobEffect;
|
||||||
import net.minecraft.server.MobEffectList;
|
import net.minecraft.server.MobEffectList;
|
||||||
|
import net.minecraft.server.Packet42RemoveMobEffect;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
|
@ -237,6 +238,10 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||||
|
|
||||||
public void removePotionEffect(PotionEffectType type) {
|
public void removePotionEffect(PotionEffectType type) {
|
||||||
getHandle().effects.remove(type.getId());
|
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() {
|
public Collection<PotionEffect> getActivePotionEffects() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue