Skip to content

Commit

Permalink
added switching offhand with mainhand via PlayerAction packet (#608)
Browse files Browse the repository at this point in the history
i added the code to make switching the items in main and offhand work
with the PlayerAction from it.
I tested it and it worked.
  • Loading branch information
cooltexture1 authored Feb 22, 2024
1 parent ccac1f3 commit 930477f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/valence_inventory/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,9 @@ fn handle_player_actions(
}
}
PlayerAction::SwapItemWithOffhand => {
// TODO
if let Ok((mut inv, _, held)) = clients.get_mut(packet.client) {
inv.swap_slot(held.slot(), PlayerInventory::SLOT_OFFHAND);
}
}
_ => {}
}
Expand Down

0 comments on commit 930477f

Please sign in to comment.