mirror of
https://github.com/minetest-mods/technic.git
synced 2025-01-03 03:07:36 +01:00
Fix generators
This commit is contained in:
parent
354ee6f313
commit
a35db449b3
@ -63,7 +63,7 @@ function technic.register_generator(data)
|
|||||||
local burn_totaltime = meta:get_int("burn_totaltime")
|
local burn_totaltime = meta:get_int("burn_totaltime")
|
||||||
-- If more to burn and the energy produced was used: produce some more
|
-- If more to burn and the energy produced was used: produce some more
|
||||||
if burn_time > 0 then
|
if burn_time > 0 then
|
||||||
meta:set_int(data.tier.."_EU_supply", data.supply)
|
meta:set_int(tier.."_EU_supply", data.supply)
|
||||||
burn_time = burn_time - 1
|
burn_time = burn_time - 1
|
||||||
meta:set_int("burn_time", burn_time)
|
meta:set_int("burn_time", burn_time)
|
||||||
end
|
end
|
||||||
@ -84,10 +84,10 @@ function technic.register_generator(data)
|
|||||||
stack:take_item()
|
stack:take_item()
|
||||||
inv:set_stack("src", 1, stack)
|
inv:set_stack("src", 1, stack)
|
||||||
hacky_swap_node(pos, "technic:"..ltier.."_generator_active")
|
hacky_swap_node(pos, "technic:"..ltier.."_generator_active")
|
||||||
meta:set_int(data.tier.."_EU_supply", data.supply)
|
meta:set_int(tier.."_EU_supply", data.supply)
|
||||||
else
|
else
|
||||||
hacky_swap_node(pos, "technic:"..ltier.."_generator")
|
hacky_swap_node(pos, "technic:"..ltier.."_generator")
|
||||||
meta:set_int(data.tier.."_EU_supply", 0)
|
meta:set_int(tier.."_EU_supply", 0)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if burn_totaltime == 0 then burn_totaltime = 1 end
|
if burn_totaltime == 0 then burn_totaltime = 1 end
|
||||||
@ -102,7 +102,7 @@ function technic.register_generator(data)
|
|||||||
"list[current_player;main;0, 5;8, 4;]")
|
"list[current_player;main;0, 5;8, 4;]")
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
technic.register_machine(data.tier, "technic:"..ltier.."_generator", technic.producer)
|
technic.register_machine(tier, "technic:"..ltier.."_generator", technic.producer)
|
||||||
technic.register_machine(data.tier, "technic:"..ltier.."_generator", technic.producer)
|
technic.register_machine(tier, "technic:"..ltier.."_generator_active", technic.producer)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user