diff options
| author | mat <git@matdoes.dev> | 2025-10-12 23:01:54 +0300 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-10-12 23:01:54 +0300 |
| commit | ee2575794e91b9457a74a95daf1dcc707058cd58 (patch) | |
| tree | df725850ef18ded5ce3f6552e17095d0f704ae84 /azalea-inventory | |
| parent | 1a1402954b07cd77615d0afc026c73b008787f51 (diff) | |
| download | azalea-drasl-ee2575794e91b9457a74a95daf1dcc707058cd58.tar.xz | |
upgrade deps and clean up lots of doc comments
Diffstat (limited to 'azalea-inventory')
| -rw-r--r-- | azalea-inventory/azalea-inventory-macros/src/menu_impl.rs | 12 | ||||
| -rw-r--r-- | azalea-inventory/src/operations.rs | 18 | ||||
| -rw-r--r-- | azalea-inventory/src/slot.rs | 5 |
3 files changed, 23 insertions, 12 deletions
diff --git a/azalea-inventory/azalea-inventory-macros/src/menu_impl.rs b/azalea-inventory/azalea-inventory-macros/src/menu_impl.rs index 4840f84c..1540fdff 100644 --- a/azalea-inventory/azalea-inventory-macros/src/menu_impl.rs +++ b/azalea-inventory/azalea-inventory-macros/src/menu_impl.rs @@ -174,14 +174,18 @@ pub fn generate(input: &DeclareMenus) -> TokenStream { }) } - /// Get the range of slot indexes that contain the player's inventory. This may be different for each menu. + /// Get the range of slot indexes that contain the player's inventory. + /// + /// This may be different for each menu. pub fn player_slots_range(&self) -> RangeInclusive<usize> { match self { #player_slots_range_match_variants } } - /// Get the range of slot indexes that contain the player's hotbar. This may be different for each menu. + /// Get the range of slot indexes that contain the player's hotbar. + /// + /// This may be different for each menu. /// /// ``` /// # let inventory = azalea_inventory::Menu::Player(azalea_inventory::Player::default()); @@ -192,7 +196,9 @@ pub fn generate(input: &DeclareMenus) -> TokenStream { ((*self.player_slots_range().end() - 8)..=*self.player_slots_range().end()) } - /// Get the range of slot indexes that contain the player's inventory, not including the hotbar. This may be different for each menu. + /// Get the range of slot indexes that contain the player's inventory, not including the hotbar. + /// + /// This may be different for each menu. pub fn player_slots_without_hotbar_range(&self) -> RangeInclusive<usize> { (*self.player_slots_range().start()..=*self.player_slots_range().end() - 9) } diff --git a/azalea-inventory/src/operations.rs b/azalea-inventory/src/operations.rs index 97ae1e60..fc42e498 100644 --- a/azalea-inventory/src/operations.rs +++ b/azalea-inventory/src/operations.rs @@ -27,11 +27,13 @@ pub enum ClickOperation { #[derive(Debug, Clone)] pub enum PickupClick { - /// Left mouse click. Note that in the protocol, None is represented as - /// -999. + /// Left mouse click. + /// + /// Note that in the protocol, None is represented as -999. Left { slot: Option<u16> }, - /// Right mouse click. Note that in the protocol, None is represented as - /// -999. + /// Right mouse click. + /// + /// Note that in the protocol, None is represented as -999. Right { slot: Option<u16> }, /// Drop cursor stack. LeftOutside, @@ -134,11 +136,13 @@ impl From<QuickCraftStatus> for QuickCraftStatusKind { } } -/// Double click +/// Double click. #[derive(Debug, Clone)] pub struct PickupAllClick { - /// The slot that we're double clicking on. It should be empty or at least - /// not pickup-able (since the carried item is used as the filter). + /// The slot that we're double clicking on. + /// + /// It should be empty or at least not pickup-able (since the carried item + /// is used as the filter). pub slot: u16, /// Impossible in vanilla clients. pub reversed: bool, diff --git a/azalea-inventory/src/slot.rs b/azalea-inventory/src/slot.rs index 2d4202e8..d19ab177 100644 --- a/azalea-inventory/src/slot.rs +++ b/azalea-inventory/src/slot.rs @@ -146,8 +146,9 @@ impl Serialize for ItemStack { } } -/// An item in an inventory, with a count and NBT. Usually you want -/// [`ItemStack`] or [`azalea_registry::Item`] instead. +/// An item in an inventory, with a count and a set of data components. +/// +/// Usually you want [`ItemStack`] or [`azalea_registry::Item`] instead. #[derive(Debug, Clone, PartialEq, Serialize)] pub struct ItemStackData { #[serde(rename = "id")] |
