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, ParticleDef, 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 #[data(default)]
34 pub particles: Vec<ParticleDef>,
35}
36
37#[derive(Debug, Clone, Schema)]
40pub struct Item {
41 pub id: String,
42 pub max_stack: i32,
43 pub name: String,
45 pub tooltip: String,
47 pub max_damage: i32,
48 pub fire_resistant: bool,
49 pub fuel_ticks: i32,
50 pub food: Option<FoodDef>,
51 pub book: bool,
53 pub tool: Option<Tool>,
54 pub armor: Option<Armor>,
55 pub wearable: Option<ArmorSlot>,
57 pub hangs: Option<Hangs>,
58}
59
60#[derive(Debug, Clone, Schema)]
64pub struct Tool {
65 pub kind: String,
66 pub attack_damage: Option<f32>,
68 pub attack_speed: Option<f32>,
69 pub material: ToolMaterial,
70 pub game_tool: Option<GameTool>,
71}
72
73#[derive(Debug, Clone, Schema)]
75pub struct Armor {
76 pub slot: ArmorSlot,
77 pub material: ArmorMaterial,
78}
79
80#[derive(Debug, Clone, Schema)]
83pub struct Hangs {
84 pub entity: String,
85 pub width: i32,
86 pub height: i32,
87}
88
89#[derive(Debug, Clone, Schema)]
91pub struct Block {
92 pub id: String,
93 pub hardness: f32,
94 pub resistance: f32,
95 pub name: String,
97 pub shape: Option<Vec<f32>>,
99 pub light: i32,
100 pub sound: Option<SoundGroup>,
101 pub requires_tool: bool,
102 pub no_collision: bool,
103 pub slipperiness: f32,
104 pub connects: bool,
105 pub connect_groups: Vec<String>,
106 pub inventory: Option<String>,
108 pub redstone: bool,
110 pub facing: Option<Facing>,
112 pub placement: Placement,
113 pub attach: bool,
114 pub waterlogged: bool,
115 pub properties: Vec<BlockProperty>,
117 pub powered: Option<String>,
118 pub comparator: Option<String>,
119 pub accepts_items: bool,
120 pub no_occlusion: bool,
121 pub kind: String,
123 pub base: Option<String>,
125 pub set: Option<String>,
127 pub press_ticks: i32,
128 pub mobs_only: bool,
129}
130
131#[derive(Debug, Clone, Schema)]
134pub struct Inventory {
135 pub id: String,
136 pub slot_count: i32,
137 pub slots: Vec<InventorySlot>,
138 pub include_player_inventory: bool,
139 pub player_inv: Vec<f32>,
141 pub background_texture: Option<String>,
142 pub title: String,
143 pub background_size: Option<Vec<f32>>,
145 pub machine: Option<Machine>,
146}
147
148#[derive(Debug, Clone, Schema)]
150pub struct InventorySlot {
151 pub at: Vec<f32>,
152 pub accepts: Vec<String>,
153}
154
155#[derive(Debug, Clone, Schema)]
157pub struct Machine {
158 pub places: Vec<i32>,
159 pub result: i32,
160}
161
162#[derive(Debug, Clone, Schema)]
164pub struct Recipe {
165 pub namespace: String,
166 pub name: String,
167 pub recipe: Value,
168}
169
170#[derive(Debug, Clone, Schema)]
172pub struct Dimension {
173 pub id: String,
174 pub def: Value,
175}
176
177#[derive(Debug, Clone, Schema)]
180pub struct Font {
181 pub id: String,
182 #[data(with = "Raw")]
183 pub png: Vec<u8>,
184 pub rows: Vec<String>,
186 pub ascent: i32,
188 pub height: i32,
189}