Fixed Disk Manipulator crashing due to empty stack, fixes #1182

This commit is contained in:
raoulvdberge
2017-04-25 20:57:28 +02:00
parent 97855e4e75
commit 733dffd446
2 changed files with 13 additions and 10 deletions

View File

@@ -1,5 +1,8 @@
# Refined Storage Changelog
### 1.4.4
- Fixed Disk Manipulator crashing due to empty stack (raoulvdberge)
### 1.4.3
- Updated Forge to 2282 (raoulvdberge)
- Updated JEI version (raoulvdberge)

View File

@@ -216,14 +216,14 @@ public class NetworkNodeDiskManipulator extends NetworkNode implements IComparab
}
} else {
while (itemFilters.getSlots() > i && extracted == null) {
ItemStack stack = null;
ItemStack filterStack = ItemStack.EMPTY;
while (itemFilters.getSlots() > i && stack == null) {
stack = itemFilters.getStackInSlot(i++);
while (itemFilters.getSlots() > i && filterStack == null) {
filterStack = itemFilters.getStackInSlot(i++);
}
if (stack != null) {
extracted = network.extractItem(stack, upgrades.getItemInteractCount(), compare, false);
if (!filterStack.isEmpty()) {
extracted = network.extractItem(filterStack, upgrades.getItemInteractCount(), compare, false);
}
}
}
@@ -293,14 +293,14 @@ public class NetworkNodeDiskManipulator extends NetworkNode implements IComparab
}
} else {
while (fluidFilters.getSlots() > i && extracted == null) {
FluidStack stack = null;
FluidStack filterStack = null;
while (fluidFilters.getSlots() > i && stack == null) {
stack = fluidFilters.getFluidStackInSlot(i++);
while (fluidFilters.getSlots() > i && filterStack == null) {
filterStack = fluidFilters.getFluidStackInSlot(i++);
}
if (stack != null) {
extracted = network.extractFluid(stack, upgrades.getItemInteractCount(), compare, false);
if (filterStack != null) {
extracted = network.extractFluid(filterStack, upgrades.getItemInteractCount(), compare, false);
}
}
}