diff options
| author | mat <git@matdoes.dev> | 2025-06-04 10:26:32 +0330 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-06-04 10:26:32 +0330 |
| commit | 93a96786a8a46068f5d9d7d3e503645d7fc4b830 (patch) | |
| tree | 8ba5daea9a93e31c1367c6672bf14eb5e0408296 /azalea-client | |
| parent | 123c15a2936639244c3485c5db789c845f7c2e43 (diff) | |
| download | azalea-drasl-93a96786a8a46068f5d9d7d3e503645d7fc4b830.tar.xz | |
handle set_held_slot packet and add more Into BlockStates impls
Diffstat (limited to 'azalea-client')
| -rw-r--r-- | azalea-client/src/plugins/packet/game/mod.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/azalea-client/src/plugins/packet/game/mod.rs b/azalea-client/src/plugins/packet/game/mod.rs index 670058c3..2fb9e1cd 100644 --- a/azalea-client/src/plugins/packet/game/mod.rs +++ b/azalea-client/src/plugins/packet/game/mod.rs @@ -1608,7 +1608,16 @@ impl GamePacketHandler<'_> { pub fn store_cookie(&mut self, _p: &ClientboundStoreCookie) {} pub fn transfer(&mut self, _p: &ClientboundTransfer) {} pub fn move_minecart_along_track(&mut self, _p: &ClientboundMoveMinecartAlongTrack) {} - pub fn set_held_slot(&mut self, _p: &ClientboundSetHeldSlot) {} + pub fn set_held_slot(&mut self, p: &ClientboundSetHeldSlot) { + debug!("Got set held slot packet {p:?}"); + + as_system::<Query<&mut Inventory>>(self.ecs, |mut query| { + let mut inventory = query.get_mut(self.player).unwrap(); + if p.slot <= 8 { + inventory.selected_hotbar_slot = p.slot as u8; + } + }); + } pub fn set_player_inventory(&mut self, _p: &ClientboundSetPlayerInventory) {} pub fn projectile_power(&mut self, _p: &ClientboundProjectilePower) {} pub fn custom_report_details(&mut self, _p: &ClientboundCustomReportDetails) {} |
