use of net.minecraft.server.v1_16_R2.EntityPlayer in project PublicCrafters by BananaPuncher714.
the class ContainerManager_v1_16_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);
}
}
use of net.minecraft.server.v1_16_R2.EntityPlayer in project PublicCrafters by BananaPuncher714.
the class ContainerManager_v1_16_R3 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));
}
use of net.minecraft.server.v1_16_R2.EntityPlayer in project PublicCrafters by BananaPuncher714.
the class ContainerManager_v1_8_R3 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);
}
}
use of net.minecraft.server.v1_16_R2.EntityPlayer in project PublicCrafters by BananaPuncher714.
the class ContainerManager_v1_9_R2 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));
}
use of net.minecraft.server.v1_16_R2.EntityPlayer in project PublicCrafters by BananaPuncher714.
the class ContainerManager_v1_9_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);
}
}
Aggregations