diff --git a/machines/simple_electric_item_processor.lua b/machines/simple_electric_item_processor.lua index 18ceb6e..458e075 100644 --- a/machines/simple_electric_item_processor.lua +++ b/machines/simple_electric_item_processor.lua @@ -98,12 +98,10 @@ function industrialtest.SimpleElectricItemProcessor.onMetadataInventoryMove(self local inv=meta:get_inventory() local srcSlot=inv:get_stack("src",1) local dstSlot=inv:get_stack("dst",1) - if fromList=="src" and count==srcSlot:get_count() then + if fromList=="src" and srcSlot:is_empty() then meta:set_float("srcTime",-1) meta:set_float("maxSrcTime",0) - if meta:get_int("industrialtest.powerAmount")>0 then - self:updateFormspec(pos) - end + self:updateFormspec(pos) elseif fromList=="dst" and dstSlot:get_free_space()>0 then self:triggerIfNeeded(pos) end @@ -120,12 +118,10 @@ function industrialtest.SimpleElectricItemProcessor.onMetadataInventoryTake(self local inv=meta:get_inventory() local srcSlot=inv:get_stack("src",1) local dstSlot=inv:get_stack("dst",1) - if listname=="src" and stack:get_count()==srcSlot:get_count() then + if listname=="src" and srcSlot:is_empty() then meta:set_float("srcTime",-1) meta:set_float("maxSrcTime",0) - if meta:get_int("industrialtest.powerAmount")>0 then - self:updateFormspec(pos) - end + self:updateFormspec(pos) elseif listname=="dst" and dstSlot:get_free_space()>0 then self:triggerIfNeeded(pos) end