Fixed Exporter in Regulator Mode not regulating properly when same item is specified multiple times, fixes #1563

This commit is contained in:
raoulvdberge
2017-12-07 19:53:32 +01:00
parent b5033f4f12
commit 6ba8924352
2 changed files with 11 additions and 2 deletions

View File

@@ -3,6 +3,7 @@
### 1.5.26 ### 1.5.26
- Added Funky Locomotion integration (raoulvdberge) - Added Funky Locomotion integration (raoulvdberge)
- Minor fixes to autocrafting (raoulvdberge) - Minor fixes to autocrafting (raoulvdberge)
- Fixed Exporter in Regulator Mode not regulating properly when same item is specified multiple times (raoulvdberge)
### 1.5.25 ### 1.5.25
- Fixed not being able to autocraft different Storage Drawers' wood drawers (raoulvdberge) - Fixed not being able to autocraft different Storage Drawers' wood drawers (raoulvdberge)

View File

@@ -145,7 +145,15 @@ public class NetworkNodeExporter extends NetworkNode implements IComparable, ITy
} }
} }
stackSize = slot.getCount() - found; int needed = 0;
for (int i = 0; i < itemFilters.getSlots(); ++i) {
if (API.instance().getComparer().isEqualNoQuantity(slot, itemFilters.getStackInSlot(i))) {
needed += itemFilters.getStackInSlot(i).getCount();
}
}
stackSize = needed - found;
if (stackSize <= 0) { if (stackSize <= 0) {
return; return;
@@ -158,7 +166,7 @@ public class NetworkNodeExporter extends NetworkNode implements IComparable, ITy
if (took == null) { if (took == null) {
if (upgrades.hasUpgrade(ItemUpgrade.TYPE_CRAFTING)) { if (upgrades.hasUpgrade(ItemUpgrade.TYPE_CRAFTING)) {
network.getCraftingManager().schedule(slot, 1, compare); network.getCraftingManager().schedule(slot, stackSize, compare);
} }
} else if (ItemHandlerHelper.insertItem(handler, took, true).isEmpty()) { } else if (ItemHandlerHelper.insertItem(handler, took, true).isEmpty()) {
took = network.extractItem(slot, Math.min(slot.getMaxStackSize(), stackSize), compare, false); took = network.extractItem(slot, Math.min(slot.getMaxStackSize(), stackSize), compare, false);