From c71d207ee2c598a97e4582ee6fb28e480fe27792 Mon Sep 17 00:00:00 2001 From: Gabriel Tofvesson Date: Thu, 15 May 2025 02:24:06 +0200 Subject: [PATCH] Clear empty slots from cache --- localchest.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/localchest.lua b/localchest.lua index 49c83f0..01b5d68 100644 --- a/localchest.lua +++ b/localchest.lua @@ -74,6 +74,9 @@ function prototype:moveItemsTo(count, fromSlot, otherChest, toSlot) local tx = self.peripheral.pushItems(peripheral.getName(otherChest.peripheral), fromSlot, count, toSlot) myStack.count = myStack.count - tx + if myStack.count == 0 then + self.slots[fromSlot] = nil + end targetStack.count = targetStack.count + tx return tx