use of net.minecraft.server.v1_14_R1.PacketPlayOutRemoveEntityEffect in project MechanicsMain by WeaponMechanics.
the class Scope_1_11_R1 method removeNightVision.
@Override
public void removeNightVision(Player player) {
if (player.hasPotionEffect(PotionEffectType.NIGHT_VISION)) {
EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
// Simply remove the entity effect
PacketPlayOutRemoveEntityEffect removeEntityEffect = new PacketPlayOutRemoveEntityEffect(player.getEntityId(), MobEffectList.fromId(PotionEffectType.NIGHT_VISION.getId()));
entityPlayer.playerConnection.sendPacket(removeEntityEffect);
// resend the existing one
MobEffect mobEffect = entityPlayer.getEffect(MobEffectList.fromId(PotionEffectType.NIGHT_VISION.getId()));
PacketPlayOutEntityEffect entityEffect = new PacketPlayOutEntityEffect(player.getEntityId(), mobEffect);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(entityEffect);
return;
}
// Simply remove the entity effect
PacketPlayOutRemoveEntityEffect removeEntityEffect = new PacketPlayOutRemoveEntityEffect(player.getEntityId(), MobEffectList.fromId(PotionEffectType.NIGHT_VISION.getId()));
((CraftPlayer) player).getHandle().playerConnection.sendPacket(removeEntityEffect);
}
use of net.minecraft.server.v1_14_R1.PacketPlayOutRemoveEntityEffect in project MechanicsMain by WeaponMechanics.
the class Scope_1_12_R1 method removeNightVision.
@Override
public void removeNightVision(Player player) {
if (player.hasPotionEffect(PotionEffectType.NIGHT_VISION)) {
EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
// Simply remove the entity effect
PacketPlayOutRemoveEntityEffect removeEntityEffect = new PacketPlayOutRemoveEntityEffect(player.getEntityId(), MobEffectList.fromId(PotionEffectType.NIGHT_VISION.getId()));
entityPlayer.playerConnection.sendPacket(removeEntityEffect);
// resend the existing one
MobEffect mobEffect = entityPlayer.getEffect(MobEffectList.fromId(PotionEffectType.NIGHT_VISION.getId()));
PacketPlayOutEntityEffect entityEffect = new PacketPlayOutEntityEffect(player.getEntityId(), mobEffect);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(entityEffect);
return;
}
// Simply remove the entity effect
PacketPlayOutRemoveEntityEffect removeEntityEffect = new PacketPlayOutRemoveEntityEffect(player.getEntityId(), MobEffectList.fromId(PotionEffectType.NIGHT_VISION.getId()));
((CraftPlayer) player).getHandle().playerConnection.sendPacket(removeEntityEffect);
}
use of net.minecraft.server.v1_14_R1.PacketPlayOutRemoveEntityEffect in project MechanicsMain by WeaponMechanics.
the class Scope_1_14_R1 method removeNightVision.
@Override
public void removeNightVision(Player player) {
if (player.hasPotionEffect(PotionEffectType.NIGHT_VISION)) {
EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
// Simply remove the entity effect
PacketPlayOutRemoveEntityEffect removeEntityEffect = new PacketPlayOutRemoveEntityEffect(player.getEntityId(), MobEffectList.fromId(PotionEffectType.NIGHT_VISION.getId()));
entityPlayer.playerConnection.sendPacket(removeEntityEffect);
// resend the existing one
MobEffect mobEffect = entityPlayer.getEffect(MobEffectList.fromId(PotionEffectType.NIGHT_VISION.getId()));
PacketPlayOutEntityEffect entityEffect = new PacketPlayOutEntityEffect(player.getEntityId(), mobEffect);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(entityEffect);
return;
}
// Simply remove the entity effect
PacketPlayOutRemoveEntityEffect removeEntityEffect = new PacketPlayOutRemoveEntityEffect(player.getEntityId(), MobEffectList.fromId(PotionEffectType.NIGHT_VISION.getId()));
((CraftPlayer) player).getHandle().playerConnection.sendPacket(removeEntityEffect);
}
use of net.minecraft.server.v1_14_R1.PacketPlayOutRemoveEntityEffect in project MechanicsMain by WeaponMechanics.
the class Scope_1_15_R1 method removeNightVision.
@Override
public void removeNightVision(Player player) {
if (player.hasPotionEffect(PotionEffectType.NIGHT_VISION)) {
EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
// Simply remove the entity effect
PacketPlayOutRemoveEntityEffect removeEntityEffect = new PacketPlayOutRemoveEntityEffect(player.getEntityId(), MobEffectList.fromId(PotionEffectType.NIGHT_VISION.getId()));
entityPlayer.playerConnection.sendPacket(removeEntityEffect);
// resend the existing one
MobEffect mobEffect = entityPlayer.getEffect(MobEffectList.fromId(PotionEffectType.NIGHT_VISION.getId()));
PacketPlayOutEntityEffect entityEffect = new PacketPlayOutEntityEffect(player.getEntityId(), mobEffect);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(entityEffect);
return;
}
// Simply remove the entity effect
PacketPlayOutRemoveEntityEffect removeEntityEffect = new PacketPlayOutRemoveEntityEffect(player.getEntityId(), MobEffectList.fromId(PotionEffectType.NIGHT_VISION.getId()));
((CraftPlayer) player).getHandle().playerConnection.sendPacket(removeEntityEffect);
}
use of net.minecraft.server.v1_14_R1.PacketPlayOutRemoveEntityEffect in project MechanicsMain by WeaponMechanics.
the class Scope_1_9_R2 method removeNightVision.
@Override
public void removeNightVision(Player player) {
if (player.hasPotionEffect(PotionEffectType.NIGHT_VISION)) {
EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
// Simply remove the entity effect
PacketPlayOutRemoveEntityEffect removeEntityEffect = new PacketPlayOutRemoveEntityEffect(player.getEntityId(), MobEffectList.fromId(PotionEffectType.NIGHT_VISION.getId()));
entityPlayer.playerConnection.sendPacket(removeEntityEffect);
// resend the existing one
MobEffect mobEffect = entityPlayer.getEffect(MobEffectList.fromId(PotionEffectType.NIGHT_VISION.getId()));
PacketPlayOutEntityEffect entityEffect = new PacketPlayOutEntityEffect(player.getEntityId(), mobEffect);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(entityEffect);
return;
}
// Simply remove the entity effect
PacketPlayOutRemoveEntityEffect removeEntityEffect = new PacketPlayOutRemoveEntityEffect(player.getEntityId(), MobEffectList.fromId(PotionEffectType.NIGHT_VISION.getId()));
((CraftPlayer) player).getHandle().playerConnection.sendPacket(removeEntityEffect);
}
Aggregations