Fix: Stack size limits on Farming Station

* The Farming Station's stack size limitations now actually work. Cases:
** Manual insert
** Shift-Click
** Pulling
** Pushing (e.g. item conduits)
** Harvesting
This commit is contained in:
HenryLoenwind committed 2015-03-20 19:45:13 +01:00
1 parent 6d8cf393d9
commit 191c5800fd
3 files changed
+38 -10

No files matched your search

@@ -367,7 +367,7 @@ public abstract class AbstractMachineEntity extends TileEntityEio implements ISi
boolean hasSpace = false;
for (int slot = slotDefinition.minInputSlot; slot <= slotDefinition.maxInputSlot && !hasSpace; slot++) {
hasSpace = inventory[slot] == null ? true : inventory[slot].stackSize < inventory[slot].getMaxStackSize();
hasSpace = inventory[slot] == null ? true : inventory[slot].stackSize < Math.min(inventory[slot].getMaxStackSize(), getInventoryStackLimit(slot));
}
if(!hasSpace) {
return false;
@@ -569,6 +569,10 @@ public abstract class AbstractMachineEntity extends TileEntityEio implements ISi
return slotDefinition.getNumSlots();
}
public int getInventoryStackLimit(int slot) {
return getInventoryStackLimit();
}
@Override
public int getInventoryStackLimit() {
return 64;
@@ -608,8 +612,8 @@ public abstract class AbstractMachineEntity extends TileEntityEio implements ISi
inventory[slot] = contents.copy();
}
if(contents != null && contents.stackSize > getInventoryStackLimit()) {
contents.stackSize = getInventoryStackLimit();
if(contents != null && contents.stackSize > getInventoryStackLimit(slot)) {
contents.stackSize = getInventoryStackLimit(slot);
}
}