Skip to content

Commit

Permalink
Fix duplication bug caused by oversized item stacks
Browse files Browse the repository at this point in the history
  • Loading branch information
theJ3H committed Jan 9, 2017
1 parent aef8f30 commit be81afa
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ protected void handleTakeOnlySlotsShiftClick(InventoryClickEvent event) {

// Calculate how many will fit
int itemsToAdd = Math.min(inventory.getMaxStackSize(), inSlot.getMaxStackSize()) - inSlot.getAmount();

itemsToAdd = Math.max(itemsToAdd, 0);
// Limit that by how many we actually have
itemsToAdd = Math.min(adding.getAmount(), itemsToAdd);

Expand Down

0 comments on commit be81afa

Please sign in to comment.