Search in sources :

Example 41 with EntityPlayer

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

the class Scope_1_10_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_10_R1.EntityPlayer) CraftPlayer(org.bukkit.craftbukkit.v1_10_R1.entity.CraftPlayer) PacketPlayOutAbilities(net.minecraft.server.v1_10_R1.PacketPlayOutAbilities)

Example 42 with EntityPlayer

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

Example 43 with EntityPlayer

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

the class Scope_1_11_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_11_R1.EntityPlayer) CraftPlayer(org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer) PacketPlayOutAbilities(net.minecraft.server.v1_11_R1.PacketPlayOutAbilities)

Example 44 with EntityPlayer

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

the class Scope_1_12_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_12_R1.EntityPlayer) CraftPlayer(org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer) PacketPlayOutAbilities(net.minecraft.server.v1_12_R1.PacketPlayOutAbilities)

Example 45 with EntityPlayer

use of net.minecraft.server.v1_16_R2.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)

Aggregations

Player (org.bukkit.entity.Player)70 ItemStack (org.bukkit.inventory.ItemStack)46 EntityPlayer (net.minecraft.server.v1_12_R1.EntityPlayer)36 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 CraftPlayer (org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer)22 EntityPlayer (net.minecraft.server.v1_14_R1.EntityPlayer)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_8_R3.entity.CraftPlayer)18 GameProfile (com.mojang.authlib.GameProfile)16 MyPet (de.Keyle.MyPet.api.entity.MyPet)16 CraftPlayer (org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer)16 EntityPlayer (net.minecraft.server.v1_16_R1.EntityPlayer)15