Skip to content

Commit

Permalink
Merge branch 'main' into equipment
Browse files Browse the repository at this point in the history
  • Loading branch information
maxomatic458 authored Oct 22, 2024
2 parents 86c22d1 + f526a17 commit 717481d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions crates/valence_inventory/src/validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,13 +291,17 @@ pub(super) fn validate_click_slot_packet(
window.slot(packet.slot_changes[0].idx as u16),
window.slot(packet.slot_changes[1].idx as u16),
];
// There are some cases where the client will add NBT data that did not
// previously exist.
ensure!(
old_slots
.iter()
.any(|s| *s == &packet.slot_changes[0].stack)
.any(|s| s.item == packet.slot_changes[0].stack.item
&& s.count == packet.slot_changes[0].stack.count)
&& old_slots
.iter()
.any(|s| *s == &packet.slot_changes[1].stack),
.any(|s| s.item == packet.slot_changes[1].stack.item
&& s.count == packet.slot_changes[1].stack.count),
"swapped items must match"
);
}
Expand Down

0 comments on commit 717481d

Please sign in to comment.