Fix possible dupe bug, and allow better support for larger item stack sizes
This commit is contained in:
parent
c0b7c16dfd
commit
3d9b81a6b0
1 changed files with 5 additions and 4 deletions
|
@ -120,14 +120,15 @@ public class TileTechStorageBase extends TileLegacyMachineBase
|
|||
if (!getStackInSlot(1).isEmpty()) {
|
||||
stacks.add(getStackInSlot(1));
|
||||
}
|
||||
for (int i = 0; i < getStoredCount() / 64; i++) {
|
||||
int size = storedItem.getMaxStackSize();
|
||||
for (int i = 0; i < getStoredCount() / size; i++) {
|
||||
ItemStack droped = storedItem.copy();
|
||||
droped.setCount(64);
|
||||
droped.setCount(size);
|
||||
stacks.add(droped);
|
||||
}
|
||||
if (getStoredCount() % 64 != 0) {
|
||||
if (getStoredCount() % size != 0) {
|
||||
ItemStack droped = storedItem.copy();
|
||||
droped.setCount(getStoredCount() % 64);
|
||||
droped.setCount(getStoredCount() % size);
|
||||
stacks.add(droped);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue