1use yog_data::Schema;
9use yog_data::Value;
10use yog_data::with::Raw;
11use yog_registry::{
12 ArmorMaterial, ArmorSlot, AttributeDef, BiomeFeature, BlockProperty, EffectDef, EntityDef,
13 Facing, FoodDef, GameTool, Placement, PotionDef, SoundGroup, ToolMaterial,
14};
15
16#[derive(Debug, Clone, Default, Schema)]
18pub struct Content {
19 pub items: Vec<Item>,
20 pub blocks: Vec<Block>,
22 pub inventories: Vec<Inventory>,
23 pub recipes: Vec<Recipe>,
24 pub biome_features: Vec<BiomeFeature>,
26 pub entities: Vec<EntityDef>,
27 pub dimensions: Vec<Dimension>,
28 pub fonts: Vec<Font>,
29 pub attributes: Vec<AttributeDef>,
30 pub effects: Vec<EffectDef>,
31 pub potions: Vec<PotionDef>,
32}
33
34#[derive(Debug, Clone, Schema)]
37pub struct Item {
38 pub id: String,
39 pub max_stack: i32,
40 pub name: String,
42 pub tooltip: String,
44 pub max_damage: i32,
45 pub fire_resistant: bool,
46 pub fuel_ticks: i32,
47 pub food: Option<FoodDef>,
48 pub book: bool,
50 pub tool: Option<Tool>,
51 pub armor: Option<Armor>,
52 pub wearable: Option<ArmorSlot>,
54 pub hangs: Option<Hangs>,
55}
56
57#[derive(Debug, Clone, Schema)]
61pub struct Tool {
62 pub kind: String,
63 pub attack_damage: Option<f32>,
65 pub attack_speed: Option<f32>,
66 pub material: ToolMaterial,
67 pub game_tool: Option<GameTool>,
68}
69
70#[derive(Debug, Clone, Schema)]
72pub struct Armor {
73 pub slot: ArmorSlot,
74 pub material: ArmorMaterial,
75}
76
77#[derive(Debug, Clone, Schema)]
80pub struct Hangs {
81 pub entity: String,
82 pub width: i32,
83 pub height: i32,
84}
85
86#[derive(Debug, Clone, Schema)]
88pub struct Block {
89 pub id: String,
90 pub hardness: f32,
91 pub resistance: f32,
92 pub name: String,
94 pub shape: Option<Vec<f32>>,
96 pub light: i32,
97 pub sound: Option<SoundGroup>,
98 pub requires_tool: bool,
99 pub no_collision: bool,
100 pub slipperiness: f32,
101 pub connects: bool,
102 pub connect_groups: Vec<String>,
103 pub inventory: Option<String>,
105 pub redstone: bool,
107 pub facing: Option<Facing>,
109 pub placement: Placement,
110 pub attach: bool,
111 pub waterlogged: bool,
112 pub properties: Vec<BlockProperty>,
114 pub powered: Option<String>,
115 pub comparator: Option<String>,
116 pub accepts_items: bool,
117 pub no_occlusion: bool,
118 pub kind: String,
120 pub base: Option<String>,
122 pub set: Option<String>,
124 pub press_ticks: i32,
125 pub mobs_only: bool,
126}
127
128#[derive(Debug, Clone, Schema)]
131pub struct Inventory {
132 pub id: String,
133 pub slot_count: i32,
134 pub slots: Vec<InventorySlot>,
135 pub include_player_inventory: bool,
136 pub player_inv: Vec<f32>,
138 pub background_texture: Option<String>,
139 pub title: String,
140 pub background_size: Option<Vec<f32>>,
142 pub machine: Option<Machine>,
143}
144
145#[derive(Debug, Clone, Schema)]
147pub struct InventorySlot {
148 pub at: Vec<f32>,
149 pub accepts: Vec<String>,
150}
151
152#[derive(Debug, Clone, Schema)]
154pub struct Machine {
155 pub places: Vec<i32>,
156 pub result: i32,
157}
158
159#[derive(Debug, Clone, Schema)]
161pub struct Recipe {
162 pub namespace: String,
163 pub name: String,
164 pub recipe: Value,
165}
166
167#[derive(Debug, Clone, Schema)]
169pub struct Dimension {
170 pub id: String,
171 pub def: Value,
172}
173
174#[derive(Debug, Clone, Schema)]
177pub struct Font {
178 pub id: String,
179 #[data(with = "Raw")]
180 pub png: Vec<u8>,
181 pub rows: Vec<String>,
183 pub ascent: i32,
185 pub height: i32,
186}