Skip to content

Commit

Permalink
Merge pull request #24 from theJ3H/master
Browse files Browse the repository at this point in the history
Fix duplication bug caused by oversized item stacks
  • Loading branch information
rutgerkok authored Jan 10, 2017
2 parents aef8f30 + be81afa commit e30bf10
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 e30bf10

Please sign in to comment.