Clear empty slots from cache

This commit is contained in:
Gabriel Tofvesson 2025-05-15 02:24:06 +02:00
parent 33ac91e24b
commit c71d207ee2

View File

@ -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