Fix shift-clicking discarding the remainder when it could fill up another stack

This commit is contained in:
Bernhard Bonigl committed 2016-03-04 13:34:19 +01:00
1 parent de49958657
commit 8461f768d7
1 file changed
+5 -2
@@ -190,8 +190,11 @@ public abstract class BaseContainer<T extends TileEntity & IInventory> extends C
// Fix for a vanilla bug: doesn't take Slot.getMaxStackSize into account
protected boolean mergeItemStack(ItemStack stack, int startIndex, int endIndex, boolean useEndIndex) {
return mergeItemStackRefill(stack, startIndex, endIndex, useEndIndex)
|| mergeItemStackMove(stack, startIndex, endIndex, useEndIndex);
boolean ret = mergeItemStackRefill(stack, startIndex, endIndex, useEndIndex);
if(stack != null && stack.stackSize > 0) {
ret |= mergeItemStackMove(stack, startIndex, endIndex, useEndIndex);
}
return ret;
}
// only refills items that are already present