use of net.minecraft.server.level.EntityPlayer in project PublicCrafters by BananaPuncher714.
the class ContainerManager_v1_17_1 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.level.EntityPlayer in project PublicCrafters by BananaPuncher714.
the class ContainerManager_v1_17_1 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.b.sendPacket(packet);
}
}
use of net.minecraft.server.level.EntityPlayer in project PublicCrafters by BananaPuncher714.
the class ContainerManager_v1_17_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.b.sendPacket(packet);
}
}
use of net.minecraft.server.level.EntityPlayer in project PublicCrafters by BananaPuncher714.
the class ContainerManager_v1_17_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));
}
use of net.minecraft.server.level.EntityPlayer in project PublicCrafters by BananaPuncher714.
the class ContainerManager_v1_18_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.b.a(packet);
}
}
Aggregations