diff options
Diffstat (limited to 'azalea-inventory')
| -rw-r--r-- | azalea-inventory/Cargo.toml | 2 | ||||
| -rw-r--r-- | azalea-inventory/src/lib.rs | 3 | ||||
| -rw-r--r-- | azalea-inventory/src/operations.rs | 25 |
3 files changed, 22 insertions, 8 deletions
diff --git a/azalea-inventory/Cargo.toml b/azalea-inventory/Cargo.toml index 994dbb2b..724030da 100644 --- a/azalea-inventory/Cargo.toml +++ b/azalea-inventory/Cargo.toml @@ -11,5 +11,5 @@ version = "0.8.0" [dependencies] azalea-buf = { version = "0.8.0", path = "../azalea-buf" } azalea-inventory-macros = { version = "0.8.0", path = "./azalea-inventory-macros" } -simdnbt = { version = "0.2.1" } +simdnbt = "0.3" azalea-registry = { version = "0.8.0", path = "../azalea-registry" } diff --git a/azalea-inventory/src/lib.rs b/azalea-inventory/src/lib.rs index dbbf1f5c..b2ea215a 100644 --- a/azalea-inventory/src/lib.rs +++ b/azalea-inventory/src/lib.rs @@ -89,6 +89,9 @@ declare_menus! { Generic3x3 { contents: 9, }, + Crafter3x3 { + contents: 9, + }, Anvil { first: 1, second: 1, diff --git a/azalea-inventory/src/operations.rs b/azalea-inventory/src/operations.rs index 29d61bd8..ca21a3e7 100644 --- a/azalea-inventory/src/operations.rs +++ b/azalea-inventory/src/operations.rs @@ -4,13 +4,13 @@ use azalea_buf::McBuf; use crate::{ item::MaxStackSizeExt, AnvilMenuLocation, BeaconMenuLocation, BlastFurnaceMenuLocation, - BrewingStandMenuLocation, CartographyTableMenuLocation, CraftingMenuLocation, - EnchantmentMenuLocation, FurnaceMenuLocation, Generic3x3MenuLocation, Generic9x1MenuLocation, - Generic9x2MenuLocation, Generic9x3MenuLocation, Generic9x4MenuLocation, Generic9x5MenuLocation, - Generic9x6MenuLocation, GrindstoneMenuLocation, HopperMenuLocation, ItemSlot, ItemSlotData, - LecternMenuLocation, LoomMenuLocation, Menu, MenuLocation, MerchantMenuLocation, Player, - PlayerMenuLocation, ShulkerBoxMenuLocation, SmithingMenuLocation, SmokerMenuLocation, - StonecutterMenuLocation, + BrewingStandMenuLocation, CartographyTableMenuLocation, Crafter3x3MenuLocation, + CraftingMenuLocation, EnchantmentMenuLocation, FurnaceMenuLocation, Generic3x3MenuLocation, + Generic9x1MenuLocation, Generic9x2MenuLocation, Generic9x3MenuLocation, Generic9x4MenuLocation, + Generic9x5MenuLocation, Generic9x6MenuLocation, GrindstoneMenuLocation, HopperMenuLocation, + ItemSlot, ItemSlotData, LecternMenuLocation, LoomMenuLocation, Menu, MenuLocation, + MerchantMenuLocation, Player, PlayerMenuLocation, ShulkerBoxMenuLocation, SmithingMenuLocation, + SmokerMenuLocation, StonecutterMenuLocation, }; #[derive(Debug, Clone)] @@ -386,6 +386,17 @@ impl Menu { ); } }, + MenuLocation::Crafter3x3(l) => match l { + Crafter3x3MenuLocation::Contents => { + self.try_move_item_to_slots(slot_index, self.player_slots_range()); + } + Crafter3x3MenuLocation::Player => { + self.try_move_item_to_slots_or_toggle_hotbar( + slot_index, + Menu::GENERIC3X3_CONTENTS_SLOTS, + ); + } + }, MenuLocation::Anvil(l) => match l { AnvilMenuLocation::Player => { self.try_move_item_to_slots_or_toggle_hotbar( |
