Fix inventories not accepting items with low stack limit even if capacity is available. Fixes #34

This commit is contained in:
Justin Aquadro committed 2014-10-22 01:59:38 -04:00
1 parent 3eaf0c009c
commit 129e2e64ce
2 files changed
+14 -8

No files matched your search

@@ -234,7 +234,8 @@ public class TileEntityCompDrawers extends TileEntityDrawersBase implements ISto
else
takeItemsFromSlot(i, -diff);
snapshotItems[i].stackSize = 64 - Math.min(64, data[i].remainingCapacity());
int itemStackLimit = getItemStackSize(i);
snapshotItems[i].stackSize = itemStackLimit - Math.min(itemStackLimit, data[i].remainingCapacity());
snapshotCounts[i] = snapshotItems[i].stackSize;
}
}
@@ -462,9 +463,10 @@ public class TileEntityCompDrawers extends TileEntityDrawersBase implements ISto
if (slot < 0 || slot >= getSizeInventory())
return null;
ItemStack stack = getItemsFromSlot(slot, getItemStackSize(slot));
int itemStackLimit = getItemStackSize(slot);
ItemStack stack = getItemsFromSlot(slot, itemStackLimit);
if (stack != null) {
stack.stackSize = 64 - Math.min(64, remainingCapacity(slot));
stack.stackSize = itemStackLimit - Math.min(itemStackLimit, remainingCapacity(slot));
snapshotItems[slot] = stack;
snapshotCounts[slot] = stack.stackSize;
}
@@ -514,7 +516,8 @@ public class TileEntityCompDrawers extends TileEntityDrawersBase implements ISto
}
if (snapshotItems[slot] != null) {
snapshotItems[slot].stackSize = 64 - Math.min(64, remainingCapacity(slot));
int itemStackLimit = getItemStackSize(slot);
snapshotItems[slot].stackSize = itemStackLimit - Math.min(itemStackLimit, remainingCapacity(slot));
snapshotCounts[slot] = snapshotItems[slot].stackSize;
}
}
@@ -203,7 +203,8 @@ public class TileEntityDrawers extends TileEntityDrawersBase implements IStorage
else
takeItemsFromSlot(i, -diff);
snapshotItems[i].stackSize = 64 - Math.min(64, data[i].remainingCapacity());
int itemStackLimit = getItemStackSize(i);
snapshotItems[i].stackSize = itemStackLimit - Math.min(itemStackLimit, data[i].remainingCapacity());
snapshotCounts[i] = snapshotItems[i].stackSize;
}
}
@@ -221,9 +222,10 @@ public class TileEntityDrawers extends TileEntityDrawersBase implements IStorage
if (slot < 0 || slot >= getSizeInventory())
return null;
ItemStack stack = getItemsFromSlot(slot, getItemStackSize(slot));
int itemStackLimit = getItemStackSize(slot);
ItemStack stack = getItemsFromSlot(slot, itemStackLimit);
if (stack != null) {
stack.stackSize = 64 - Math.min(64, data[slot].remainingCapacity());
stack.stackSize = itemStackLimit - Math.min(itemStackLimit, data[slot].remainingCapacity());
snapshotItems[slot] = stack;
snapshotCounts[slot] = stack.stackSize;
}
@@ -273,7 +275,8 @@ public class TileEntityDrawers extends TileEntityDrawersBase implements IStorage
}
if (snapshotItems[slot] != null) {
snapshotItems[slot].stackSize = 64 - Math.min(64, data[slot].remainingCapacity());
int itemStackLimit = getItemStackSize(slot);
snapshotItems[slot].stackSize = itemStackLimit - Math.min(itemStackLimit, data[slot].remainingCapacity());
snapshotCounts[slot] = snapshotItems[slot].stackSize;
}
}