use yog_data::Schema;
use yog_data::Value;
use yog_data::with::Raw;
use yog_registry::{
ArmorMaterial, ArmorSlot, AttributeDef, BiomeFeature, BlockProperty, EffectDef, EntityDef,
Facing, FoodDef, GameTool, Placement, PotionDef, SoundGroup, ToolMaterial,
};
#[derive(Debug, Clone, Default, Schema)]
pub struct Content {
pub items: Vec<Item>,
pub blocks: Vec<Block>,
pub inventories: Vec<Inventory>,
pub recipes: Vec<Recipe>,
pub biome_features: Vec<BiomeFeature>,
pub entities: Vec<EntityDef>,
pub dimensions: Vec<Dimension>,
pub fonts: Vec<Font>,
pub attributes: Vec<AttributeDef>,
pub effects: Vec<EffectDef>,
pub potions: Vec<PotionDef>,
}
#[derive(Debug, Clone, Schema)]
pub struct Item {
pub id: String,
pub max_stack: i32,
pub name: String,
pub tooltip: String,
pub max_damage: i32,
pub fire_resistant: bool,
pub fuel_ticks: i32,
pub food: Option<FoodDef>,
pub book: bool,
pub tool: Option<Tool>,
pub armor: Option<Armor>,
pub wearable: Option<ArmorSlot>,
pub hangs: Option<Hangs>,
}
#[derive(Debug, Clone, Schema)]
pub struct Tool {
pub kind: String,
pub attack_damage: Option<f32>,
pub attack_speed: Option<f32>,
pub material: ToolMaterial,
pub game_tool: Option<GameTool>,
}
#[derive(Debug, Clone, Schema)]
pub struct Armor {
pub slot: ArmorSlot,
pub material: ArmorMaterial,
}
#[derive(Debug, Clone, Schema)]
pub struct Hangs {
pub entity: String,
pub width: i32,
pub height: i32,
}
#[derive(Debug, Clone, Schema)]
pub struct Block {
pub id: String,
pub hardness: f32,
pub resistance: f32,
pub name: String,
pub shape: Option<Vec<f32>>,
pub light: i32,
pub sound: Option<SoundGroup>,
pub requires_tool: bool,
pub no_collision: bool,
pub slipperiness: f32,
pub connects: bool,
pub connect_groups: Vec<String>,
pub inventory: Option<String>,
pub redstone: bool,
pub facing: Option<Facing>,
pub placement: Placement,
pub attach: bool,
pub waterlogged: bool,
pub properties: Vec<BlockProperty>,
pub powered: Option<String>,
pub comparator: Option<String>,
pub accepts_items: bool,
pub no_occlusion: bool,
pub kind: String,
pub base: Option<String>,
pub set: Option<String>,
pub press_ticks: i32,
pub mobs_only: bool,
}
#[derive(Debug, Clone, Schema)]
pub struct Inventory {
pub id: String,
pub slot_count: i32,
pub slots: Vec<InventorySlot>,
pub include_player_inventory: bool,
pub player_inv: Vec<f32>,
pub background_texture: Option<String>,
pub title: String,
pub background_size: Option<Vec<f32>>,
pub machine: Option<Machine>,
}
#[derive(Debug, Clone, Schema)]
pub struct InventorySlot {
pub at: Vec<f32>,
pub accepts: Vec<String>,
}
#[derive(Debug, Clone, Schema)]
pub struct Machine {
pub places: Vec<i32>,
pub result: i32,
}
#[derive(Debug, Clone, Schema)]
pub struct Recipe {
pub namespace: String,
pub name: String,
pub recipe: Value,
}
#[derive(Debug, Clone, Schema)]
pub struct Dimension {
pub id: String,
pub def: Value,
}
#[derive(Debug, Clone, Schema)]
pub struct Font {
pub id: String,
#[data(with = "Raw")]
pub png: Vec<u8>,
pub rows: Vec<String>,
pub ascent: i32,
pub height: i32,
}