From 396e811109ddf984bbd5a9094f4e354f6ac1c3a3 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sat, 13 Mar 2021 11:28:50 -0500 Subject: [PATCH] Fix excessive network traffic from Extractor --- .../phycon/block/extractor/ExtractorBlockEntity.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/net/shadowfacts/phycon/block/extractor/ExtractorBlockEntity.kt b/src/main/kotlin/net/shadowfacts/phycon/block/extractor/ExtractorBlockEntity.kt index 0305717..5db555a 100644 --- a/src/main/kotlin/net/shadowfacts/phycon/block/extractor/ExtractorBlockEntity.kt +++ b/src/main/kotlin/net/shadowfacts/phycon/block/extractor/ExtractorBlockEntity.kt @@ -95,7 +95,9 @@ class ExtractorBlockEntity: DeviceBlockEntity(PhyBlockEntities.EXTRACTOR), for (slot in 0 until inventory.slotCount) { val slotStack = inventory.getInvStack(slot) if (slotStack.isEmpty) continue - dispatchItemStack(slotStack) { insertion -> + val extractable = inventory.extractStack(slot, ExactItemStackFilter(slotStack), ItemStack.EMPTY, slotStack.count, Simulation.SIMULATE) + if (extractable.isEmpty) continue + dispatchItemStack(extractable) { insertion -> insertion.inventory = inventory insertion.inventorySlot = slot }