Search in sources :

Example 46 with EntityPlayer

use of net.minecraft.server.v1_11_R1.EntityPlayer 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);
}
Also used : PacketPlayOutEntityEffect(net.minecraft.server.v1_12_R1.PacketPlayOutEntityEffect) MobEffect(net.minecraft.server.v1_12_R1.MobEffect) EntityPlayer(net.minecraft.server.v1_12_R1.EntityPlayer) PacketPlayOutRemoveEntityEffect(net.minecraft.server.v1_12_R1.PacketPlayOutRemoveEntityEffect) CraftPlayer(org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer)

Example 47 with EntityPlayer

use of net.minecraft.server.v1_11_R1.EntityPlayer in project MechanicsMain by WeaponMechanics.

the class Scope_1_16_R3 method updateAbilities.

@Override
public void updateAbilities(Player player) {
    EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
    entityPlayer.playerConnection.sendPacket(new PacketPlayOutAbilities(entityPlayer.abilities));
}
Also used : EntityPlayer(net.minecraft.server.v1_16_R3.EntityPlayer) CraftPlayer(org.bukkit.craftbukkit.v1_16_R3.entity.CraftPlayer) PacketPlayOutAbilities(net.minecraft.server.v1_16_R3.PacketPlayOutAbilities)

Example 48 with EntityPlayer

use of net.minecraft.server.v1_11_R1.EntityPlayer in project MechanicsMain by WeaponMechanics.

the class Scope_1_13_R2 method updateAbilities.

@Override
public void updateAbilities(Player player) {
    EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
    entityPlayer.playerConnection.sendPacket(new PacketPlayOutAbilities(entityPlayer.abilities));
}
Also used : EntityPlayer(net.minecraft.server.v1_13_R2.EntityPlayer) CraftPlayer(org.bukkit.craftbukkit.v1_13_R2.entity.CraftPlayer) PacketPlayOutAbilities(net.minecraft.server.v1_13_R2.PacketPlayOutAbilities)

Example 49 with EntityPlayer

use of net.minecraft.server.v1_11_R1.EntityPlayer in project MechanicsMain by WeaponMechanics.

the class Scope_1_14_R1 method updateAbilities.

@Override
public void updateAbilities(Player player) {
    EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
    entityPlayer.playerConnection.sendPacket(new PacketPlayOutAbilities(entityPlayer.abilities));
}
Also used : EntityPlayer(net.minecraft.server.v1_14_R1.EntityPlayer) CraftPlayer(org.bukkit.craftbukkit.v1_14_R1.entity.CraftPlayer) PacketPlayOutAbilities(net.minecraft.server.v1_14_R1.PacketPlayOutAbilities)

Example 50 with EntityPlayer

use of net.minecraft.server.v1_11_R1.EntityPlayer 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);
}
Also used : PacketPlayOutEntityEffect(net.minecraft.server.v1_14_R1.PacketPlayOutEntityEffect) MobEffect(net.minecraft.server.v1_14_R1.MobEffect) EntityPlayer(net.minecraft.server.v1_14_R1.EntityPlayer) PacketPlayOutRemoveEntityEffect(net.minecraft.server.v1_14_R1.PacketPlayOutRemoveEntityEffect) CraftPlayer(org.bukkit.craftbukkit.v1_14_R1.entity.CraftPlayer)

Aggregations

Player (org.bukkit.entity.Player)69 ItemStack (org.bukkit.inventory.ItemStack)46 EntityPlayer (net.minecraft.server.v1_12_R1.EntityPlayer)32 EntityPlayer (net.minecraft.server.v1_16_R3.EntityPlayer)31 EntityPlayer (net.minecraft.server.v1_8_R3.EntityPlayer)31 EntityPlayer (net.minecraft.server.v1_15_R1.EntityPlayer)26 EntityPlayer (net.minecraft.server.v1_10_R1.EntityPlayer)25 EntityPlayer (net.minecraft.server.v1_11_R1.EntityPlayer)25 EntityPlayer (net.minecraft.server.v1_13_R2.EntityPlayer)25 CraftPlayer (org.bukkit.craftbukkit.v1_16_R3.entity.CraftPlayer)23 EntityPlayer (net.minecraft.server.v1_14_R1.EntityPlayer)21 CraftPlayer (org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer)21 NPCHolder (net.citizensnpcs.npc.ai.NPCHolder)19 SkinnableEntity (net.citizensnpcs.npc.skin.SkinnableEntity)19 CraftPlayer (org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer)19 CraftPlayer (org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer)18 CraftPlayer (org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer)18 GameProfile (com.mojang.authlib.GameProfile)16 MyPet (de.Keyle.MyPet.api.entity.MyPet)16 EntityPlayer (net.minecraft.server.v1_16_R1.EntityPlayer)15