diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2024-04-23 10:34:50 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-23 10:34:50 -0500 |
| commit | 1d80f531b74bc3b31023753acb81b35efcdadd73 (patch) | |
| tree | 675635c7c41fbb456e3e0dd7b9f09c7211d356f0 /azalea-client/src/inventory.rs | |
| parent | 0ddad8bd9c7c0e8846aec8bc90c95416418c9a63 (diff) | |
| download | azalea-drasl-1d80f531b74bc3b31023753acb81b35efcdadd73.tar.xz | |
1.20.5 (#127)
* 23w51b
* make recalculate_near_end_of_path public
so other plugins can do .after(recalculate_near_end_of_path)
* update to 24w03a i think
* start implementing 24w13a
* registries work (but a lot of packets are still broken)
* fix recipes and commands packets
* i love codecs :D i am not going insane :D mojang's java is very readable :D
* item components are "implemented" meowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeowmeow
* update to 1.20.5-pre3
* fix all the broken packets and clippy (mojang please don't do an update like this again or i will murder someone)
* 1.20.5-rc1
* fix failing tests
* 1.20.5
Diffstat (limited to 'azalea-client/src/inventory.rs')
| -rw-r--r-- | azalea-client/src/inventory.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/azalea-client/src/inventory.rs b/azalea-client/src/inventory.rs index 4bfed69f..97eb98ea 100644 --- a/azalea-client/src/inventory.rs +++ b/azalea-client/src/inventory.rs @@ -252,7 +252,7 @@ impl InventoryComponent { // && slot.may_place(item_stack) && ( self.quick_craft_kind == QuickCraftKind::Middle - || item_stack.count() as i32 >= self.quick_craft_slots.len() as i32 + || item_stack.count() >= self.quick_craft_slots.len() as i32 ) { break; @@ -273,9 +273,9 @@ impl InventoryComponent { &mut new_carried, slot_item_count, ); - let max_stack_size = i8::min( + let max_stack_size = i32::min( new_carried.kind.max_stack_size(), - i8::min( + i32::min( new_carried.kind.max_stack_size(), slot.kind.max_stack_size(), ), @@ -391,7 +391,7 @@ impl InventoryComponent { }; if self.menu().may_place(source_slot_index, target_item) { let source_max_stack = self.menu().max_stack_size(source_slot_index); - if target_slot.count() > source_max_stack as i8 { + if target_slot.count() > source_max_stack as i32 { // if there's more than the max stack size in the target slot let target_slot = self.menu_mut().slot_mut(target_slot_index).unwrap(); @@ -449,7 +449,7 @@ impl InventoryComponent { ThrowClick::All { .. } => slot_item.count, }; - let _dropping = slot_item.split(dropping_count as u8); + let _dropping = slot_item.split(dropping_count as u32); // player.drop(dropping, true); } ClickOperation::PickupAll(PickupAllClick { @@ -492,7 +492,7 @@ impl InventoryComponent { let checking_slot = self.menu_mut().slot_mut(i).unwrap(); let taken_item = - checking_slot.split(checking_slot.count() as u8); + checking_slot.split(checking_slot.count() as u32); // now extend the carried item let target_slot = &mut self.carried; @@ -537,7 +537,7 @@ fn can_item_quick_replace( return false; }; - if !item.is_same_item_and_nbt(target_slot) { + if !item.is_same_item_and_components(target_slot) { return false; } let count = target_slot.count as u16 @@ -553,10 +553,10 @@ fn get_quick_craft_slot_count( quick_craft_slots: &HashSet<u16>, quick_craft_kind: &QuickCraftKind, item: &mut ItemSlotData, - slot_item_count: i8, + slot_item_count: i32, ) { item.count = match quick_craft_kind { - QuickCraftKind::Left => item.count / quick_craft_slots.len() as i8, + QuickCraftKind::Left => item.count / quick_craft_slots.len() as i32, QuickCraftKind::Right => 1, QuickCraftKind::Middle => item.kind.max_stack_size(), }; |
