default active infotexts

This commit is contained in:
Evert Prants 2018-04-11 11:35:34 +03:00
parent 803ecc59c6
commit e1a570d245
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
2 changed files with 7 additions and 6 deletions

View File

@ -248,6 +248,9 @@ function holostorage.network.register_abm_controller(name)
end
if nodedef and nodedef.holostorage_run then
nodedef.holostorage_run(pos2, node2, pos)
elseif nodedef then
local imeta = minetest.get_meta(pos2)
imeta:set_string("infotext", ("%s Active"):format(nodedef.description))
end
end
end

View File

@ -132,12 +132,10 @@ local function run_solderer(pos, _, controller)
while true do
local result = holostorage.solderer.get_recipe(inv:get_list("src"))
if not result then
local swap = holostorage.helpers.swap_node(pos, machine_node)
if swap then
holostorage.helpers.swap_node(pos, machine_node)
meta:set_string("infotext", "Solderer Idle")
meta:set_string("formspec", get_formspec())
meta:set_int("src_time", 0)
end
return
end
meta:set_int("src_time", meta:get_int("src_time") + round(machine_speed * 10))