use bevy::prelude::{Event, Resource};
use fmc_protocol_derive::{ClientBound, ServerBound};
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use crate::BlockId;
#[derive(ServerBound, Serialize, Deserialize, Debug, Clone)]
pub struct ClientReady;
#[derive(Resource, Event, ClientBound, Serialize, Deserialize, Debug, Clone)]
pub struct ServerConfig {
pub assets_hash: u64,
pub block_ids: HashMap<String, BlockId>,
pub model_ids: HashMap<String, u32>,
pub item_ids: HashMap<String, u32>,
pub render_distance: u32,
}
#[derive(ServerBound, Serialize, Deserialize, Debug)]
pub struct ClientIdentification {
pub name: String,
}
#[derive(ClientBound, Event, Serialize, Deserialize, Debug)]
pub struct Disconnect {
pub message: String,
}
#[derive(ClientBound, Event, Serialize, Deserialize, Debug, Clone)]
pub struct Time {
pub angle: f32,
}
#[derive(ClientBound, Event, Serialize, Deserialize, Debug)]
pub struct AssetResponse {
pub file: Vec<u8>,
}
#[derive(ServerBound, Serialize, Deserialize, Debug, Clone, Copy)]
pub struct AssetRequest;