Fixed Exporter not exporting anything when using a Stack Upgrade and there isn't space for 64 items in the inventory. Fixes #2128

This commit is contained in:
raoulvdberge
2020-04-26 15:53:48 +02:00
parent 679a04d39f
commit 02d6ac253e
2 changed files with 10 additions and 3 deletions

View File

@@ -3,6 +3,7 @@
### 1.8.3
- Added a new experimental autocrafting engine that's enabled by default. This should improve autocrafting performance (Darkere)
- Wireless Transmitters can now be placed on any block and in any direction (raoulvdberge)
- Fixed Exporter not exporting anything when using a Stack Upgrade and there isn't space for 64 items in the inventory (raoulvdberge)
### 1.8.2
- Add Refined Storage silicon to forge:silicon tag for mod compatibility (jeremiahwinsley)

View File

@@ -85,10 +85,16 @@ public class ExporterNetworkNode extends NetworkNode implements IComparable, ITy
if (upgrades.hasUpgrade(UpgradeItem.Type.CRAFTING)) {
network.getCraftingManager().request(new SlottedCraftingRequest(this, filterSlot), slot, stackSize);
}
} else if (ItemHandlerHelper.insertItem(handler, took, true).isEmpty()) {
took = network.extractItem(slot, Math.min(slot.getMaxStackSize(), stackSize), compare, Action.PERFORM);
} else {
ItemStack remainder = ItemHandlerHelper.insertItem(handler, took, true);
ItemHandlerHelper.insertItem(handler, took, false);
int correctedStackSize = took.getCount() - remainder.getCount();
if (correctedStackSize > 0) {
took = network.extractItem(slot, correctedStackSize, compare, Action.PERFORM);
ItemHandlerHelper.insertItem(handler, took, false);
}
}
}