use serde::{Deserialize, Serialize};
use serde_json::Value as JsonValue;
use std::collections::HashMap;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
/// An item stack
pub struct ItemStack {
/// The item's ID
///
/// A custom datapack can in theory prevent access to the ID, so it is an [`Option`] as a
/// result. Unwrapping this to access the ID will never fail normally.
pub id: Option<String>,
/// The number of items in the stack
pub count: u32,
/// The item's data components
#[serde(default)]
pub components: HashMap<String, JsonValue>,
}