Pumpkin/pumpkin-world/src/loot/mod.rs
Alexander Medvedev ef497fb435 Refactor World Entity System
Also support Item drops (WIP)
2025-01-31 21:45:20 +01:00

38 lines
768 B
Rust

use serde::Deserialize;
#[expect(dead_code)]
#[derive(Deserialize, Clone)]
pub struct LootTable {
r#type: LootTableType,
pools: Option<Vec<LootPool>>,
}
#[expect(dead_code)]
#[derive(Deserialize, Clone)]
pub struct LootPool {
entries: Vec<LootPoolEntry>,
}
#[expect(dead_code)]
#[derive(Deserialize, Clone)]
pub struct LootPoolEntry {
// TODO
r#type: Option<String>,
// TODO
name: Option<String>,
}
#[derive(Deserialize, Clone)]
#[serde(rename = "snake_case")]
pub enum LootTableType {
#[serde(rename = "minecraft:empty")]
/// Nothing will be droped
Empty,
#[serde(rename = "minecraft:block")]
/// A Block will be droped
Block,
#[serde(rename = "minecraft:chest")]
/// A Item will be droped
Chest,
}