azalea_inventory/item/
mod.rs

1pub mod consume_effect;
2
3pub trait MaxStackSizeExt {
4    /// Get the maximum stack size for this item.
5    ///
6    /// This is a signed integer to be consistent with the `count` field of
7    /// [`ItemStackData`].
8    ///
9    /// [`ItemStackData`]: crate::ItemStackData
10    fn max_stack_size(&self) -> i32;
11
12    /// Whether this item can be stacked with other items.
13    ///
14    /// This is equivalent to `self.max_stack_size() > 1`.
15    fn stackable(&self) -> bool {
16        self.max_stack_size() > 1
17    }
18}
19
20impl MaxStackSizeExt for azalea_registry::Item {
21    fn max_stack_size(&self) -> i32 {
22        // TODO: have the properties for every item defined somewhere
23        64
24    }
25}