azalea_inventory/item/
mod.rs

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