Search in sources :

Example 31 with EntityPlayer

use of net.minecraft.server.v1_14_R1.EntityPlayer in project PublicCrafters by BananaPuncher714.

the class ContainerManager_v1_13_R1 method animate.

@Override
public void animate(Player player) {
    EntityPlayer NMSPlayer = ((CraftPlayer) player).getHandle();
    broadcastPacket(player, new PacketPlayOutAnimation(NMSPlayer, ThreadLocalRandom.current().nextInt(2) == 1 ? 0 : 3));
}
Also used : EntityPlayer(net.minecraft.server.v1_13_R1.EntityPlayer) CraftPlayer(org.bukkit.craftbukkit.v1_13_R1.entity.CraftPlayer) PacketPlayOutAnimation(net.minecraft.server.v1_13_R1.PacketPlayOutAnimation)

Example 32 with EntityPlayer

use of net.minecraft.server.v1_14_R1.EntityPlayer in project PublicCrafters by BananaPuncher714.

the class ContainerManager_v1_13_R2 method broadcastPacket.

private void broadcastPacket(Player origin, Packet<?> packet) {
    Location location = origin.getLocation();
    for (Player player : Bukkit.getOnlinePlayers()) {
        if (player == origin) {
            continue;
        }
        Location ploc = player.getLocation();
        if (ploc.getWorld() != location.getWorld()) {
            continue;
        }
        if (ploc.distanceSquared(location) > 128) {
            continue;
        }
        EntityPlayer NMSPlayer = ((CraftPlayer) player).getHandle();
        NMSPlayer.playerConnection.sendPacket(packet);
    }
}
Also used : CraftPlayer(org.bukkit.craftbukkit.v1_13_R2.entity.CraftPlayer) Player(org.bukkit.entity.Player) EntityPlayer(net.minecraft.server.v1_13_R2.EntityPlayer) EntityPlayer(net.minecraft.server.v1_13_R2.EntityPlayer) CraftPlayer(org.bukkit.craftbukkit.v1_13_R2.entity.CraftPlayer) Location(org.bukkit.Location)

Example 33 with EntityPlayer

use of net.minecraft.server.v1_14_R1.EntityPlayer in project PublicCrafters by BananaPuncher714.

the class ContainerManager_v1_14_R1 method broadcastPacket.

private void broadcastPacket(Player origin, Packet<?> packet) {
    Location location = origin.getLocation();
    for (Player player : Bukkit.getOnlinePlayers()) {
        if (player == origin) {
            continue;
        }
        Location ploc = player.getLocation();
        if (ploc.getWorld() != location.getWorld()) {
            continue;
        }
        if (ploc.distanceSquared(location) > 128) {
            continue;
        }
        EntityPlayer NMSPlayer = ((CraftPlayer) player).getHandle();
        NMSPlayer.playerConnection.sendPacket(packet);
    }
}
Also used : EntityPlayer(net.minecraft.server.v1_14_R1.EntityPlayer) Player(org.bukkit.entity.Player) CraftPlayer(org.bukkit.craftbukkit.v1_14_R1.entity.CraftPlayer) EntityPlayer(net.minecraft.server.v1_14_R1.EntityPlayer) CraftPlayer(org.bukkit.craftbukkit.v1_14_R1.entity.CraftPlayer) Location(org.bukkit.Location)

Example 34 with EntityPlayer

use of net.minecraft.server.v1_14_R1.EntityPlayer in project PublicCrafters by BananaPuncher714.

the class ContainerManager_v1_11_R1 method broadcastPacket.

private void broadcastPacket(Player origin, Packet<?> packet) {
    Location location = origin.getLocation();
    for (Player player : Bukkit.getOnlinePlayers()) {
        if (player == origin) {
            continue;
        }
        Location ploc = player.getLocation();
        if (ploc.getWorld() != location.getWorld()) {
            continue;
        }
        if (ploc.distanceSquared(location) > 128) {
            continue;
        }
        EntityPlayer NMSPlayer = ((CraftPlayer) player).getHandle();
        NMSPlayer.playerConnection.sendPacket(packet);
    }
}
Also used : Player(org.bukkit.entity.Player) EntityPlayer(net.minecraft.server.v1_11_R1.EntityPlayer) CraftPlayer(org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer) EntityPlayer(net.minecraft.server.v1_11_R1.EntityPlayer) CraftPlayer(org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer) Location(org.bukkit.Location)

Example 35 with EntityPlayer

use of net.minecraft.server.v1_14_R1.EntityPlayer in project PublicCrafters by BananaPuncher714.

the class ContainerManager_v1_11_R1 method animate.

@Override
public void animate(Player player) {
    EntityPlayer NMSPlayer = ((CraftPlayer) player).getHandle();
    broadcastPacket(player, new PacketPlayOutAnimation(NMSPlayer, ThreadLocalRandom.current().nextInt(2) == 1 ? 0 : 3));
}
Also used : EntityPlayer(net.minecraft.server.v1_11_R1.EntityPlayer) CraftPlayer(org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer) PacketPlayOutAnimation(net.minecraft.server.v1_11_R1.PacketPlayOutAnimation)

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