Commit 1a7e3d23 authored by Fedja Beader's avatar Fedja Beader
Browse files

biofuel: add drawer support (as dest) -- compact code

parent 91a08e9b
......@@ -290,21 +290,8 @@ function biofuel_step()
setup_machine_network(biofuel.wood_crafters, biofuel.stick_crafters, biofuel.wood_name)
setup_machine_network(biofuel.stick_crafters, biofuel.refineries, "default:stick")
setup_machine_network(biofuel.refineries, biofuel.canister_crafters, "biofuel:bottle_fuel")
setup_machine_network(biofuel.canister_crafters, biofuel.drawer_controllers, "biofuel:fuel_can")
-- move from fuel can crafter to drawers
local sources = {}
for i,pos in pairs(biofuel.canister_crafters) do
local from = ItemLocations:new()
from:collect(pos, "dst", "biofuel:fuel_can")
table.insert(sources, from)
end
local to = ItemLocations:new()
for _,pos in pairs(biofuel.drawer_controllers) do
to:collect(pos, "src", "")
end
setup_multimove(sources, { to }, "biofuel:fuel_can")
core.after(30, biofuel_step) -- use after as it takes forever
end
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment