Skip to content

Commit

Permalink
fix: project bench shift-click dupe issues
Browse files Browse the repository at this point in the history
  • Loading branch information
MrTJP committed May 1, 2024
1 parent 3b5ccd1 commit 5f123e9
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ public ItemStack quickMoveStack(Player player, int slotIndex) {
if (!moveToStorage(stack, true) && !moveToEntireInventory(stack, false)) return ItemStack.EMPTY;

} else if (isResultSlot(slotIndex)) {
// Usualy, mayPickup is only queried once, and then this method is called repeatedly until EMPTY is returned.
// Since this slot is allowed to remain non-empty even after pickup is not possible, we must check this every time.
// See AbstractContainerMenu#doClick
if (!slot.mayPickup(player)) return ItemStack.EMPTY;
if (!moveToEntireInventory(stack, true) && !moveToStorage(stack, true)) return ItemStack.EMPTY;

} else if (isPlayerInventory(slotIndex) || isHotbar(slotIndex)) {
Expand Down

0 comments on commit 5f123e9

Please sign in to comment.