Restart machine if power goes back on
This commit is contained in:
parent
cf73640e75
commit
190f83a60f
@ -955,11 +955,13 @@ local function registerSimpleElectricItemProcessor(config)
|
||||
inv:set_stack("powerStorage",1,powerStorageSlot)
|
||||
end
|
||||
end
|
||||
if srcSlot:get_count()>0 and meta:get_float("maxSrcTime")<=0 and meta:get_int("industrialtest.powerAmount")>=requiredPower then
|
||||
if srcSlot:get_count()>0 and meta:get_int("industrialtest.powerAmount")>=requiredPower then
|
||||
local output=craftResultProxy(config.method,srcSlot)
|
||||
if output.time>0 and inv:room_for_item("dst",output.item) then
|
||||
meta:set_float("srcTime",0)
|
||||
meta:set_float("maxSrcTime",output.time*config.efficiency)
|
||||
if meta:get_float("maxSrcTime")<=0 then
|
||||
meta:set_float("srcTime",0)
|
||||
meta:set_float("maxSrcTime",output.time*config.efficiency)
|
||||
end
|
||||
minetest.swap_node(pos,{
|
||||
name="industrialtest:"..config.name.."_active",
|
||||
param2=minetest.get_node(pos).param2
|
||||
|
Loading…
Reference in New Issue
Block a user