diff --git a/basis/node_states.lua b/basis/node_states.lua index 6febacf..ac7373f 100644 --- a/basis/node_states.lua +++ b/basis/node_states.lua @@ -3,7 +3,7 @@ TechAge ======= - Copyright (C) 2019-2022 Joachim Stolberg + Copyright (C) 2019-2023 Joachim Stolberg AGPL v3 See LICENSE.txt for more information @@ -520,6 +520,20 @@ function NodeStates:on_beduino_request_data(pos, topic, payload) end end +function NodeStates.get_beduino_state(pos) + local node = minetest.get_node(pos) + local nvm = techage.get_nvm(pos) + if node.name == "ignore" then -- unloaded node? + return 0, {techage.UNLOADED} + elseif nvm.techage_state == RUNNING then + local ttl = (nvm.last_active or 0) + MAX_CYCLE_TIME + if ttl < minetest.get_gametime() then + return 0, {techage.INACTIVE} + end + end + return 0, {nvm.techage_state or STOPPED} +end + -- restart timer function NodeStates:on_node_load(pos) local nvm = techage.get_nvm(pos) diff --git a/doc/items.lua b/doc/items.lua index 9d85470..fa08dcb 100644 --- a/doc/items.lua +++ b/doc/items.lua @@ -115,7 +115,7 @@ techage.Items = { ta3_sequencer = "techage:ta3_sequencer", ta3_timer = "techage:ta3_timer", ta3_terminal = "techage:terminal2", - ta3_signallamp = "techage:signal_lamp_off", + ta3_colorlamp = "techage:color_lamp_off", ta3_doorblock = "techage:doorblock20", ta3_programmer = "techage:programmer", ta3_doorcontroller = "techage:ta3_doorcontroller", diff --git a/fusion_reactor/controller.lua b/fusion_reactor/controller.lua index 653602d..cc6f9e5 100644 --- a/fusion_reactor/controller.lua +++ b/fusion_reactor/controller.lua @@ -217,7 +217,6 @@ minetest.register_node("techage:ta5_fr_controller_pas", { on_timer = node_timer, after_dig_node = after_dig_node, on_receive_fields = on_receive_fields, - drawtype = "nodebox", paramtype2 = "facedir", groups = {choppy=2, cracky=2, crumbly=2}, is_ground_content = false, @@ -257,7 +256,6 @@ minetest.register_node("techage:ta5_fr_controller_act", { on_timer = node_timer, after_dig_node = after_dig_node, on_receive_fields = on_receive_fields, - drawtype = "nodebox", paramtype2 = "facedir", groups = {choppy=2, cracky=2, crumbly=2, not_in_creative_inventory=1}, drop = "", diff --git a/fusion_reactor/magnet.lua b/fusion_reactor/magnet.lua index 66889cf..9427577 100644 --- a/fusion_reactor/magnet.lua +++ b/fusion_reactor/magnet.lua @@ -54,7 +54,6 @@ minetest.register_node("techage:ta5_magnet1", { Cable:after_dig_node(pos) techage.del_mem(pos) end, - drawtype = "nodebox", paramtype2 = "facedir", groups = {choppy=2, cracky=2, crumbly=2}, is_ground_content = false, @@ -88,7 +87,6 @@ minetest.register_node("techage:ta5_magnet2", { Cable:after_dig_node(pos) techage.del_mem(pos) end, - drawtype = "nodebox", paramtype2 = "facedir", groups = {choppy=2, cracky=2, crumbly=2}, is_ground_content = false,