use of net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket in project Balm by ModdingForBlockheads.
the class BalmBlockEntity method balmSync.
@Override
public void balmSync() {
if (level != null && !level.isClientSide) {
List<? extends Player> playerList = level.players();
ClientboundBlockEntityDataPacket updatePacket = getUpdatePacket();
if (updatePacket == null) {
return;
}
for (Object obj : playerList) {
ServerPlayer player = (ServerPlayer) obj;
if (Math.hypot(player.getX() - worldPosition.getX() + 0.5, player.getZ() - worldPosition.getZ() + 0.5) < 64) {
player.connection.send(updatePacket);
}
}
}
}
Aggregations