nodetimer cleanup

This commit is contained in:
BuckarooBanzay 2020-06-16 13:03:39 +02:00
parent 28fbb7e168
commit 26fbf865b5

@ -61,12 +61,6 @@ minetest.register_node("digibuilder:digibuilder", {
end, end,
on_construct = function(pos) on_construct = function(pos)
-- start nodetimer if not started
local timer = minetest.get_node_timer(pos)
if not timer:is_started() then
timer:start(2)
end
-- inventory -- inventory
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
@ -93,15 +87,7 @@ minetest.register_node("digibuilder:digibuilder", {
return inv:is_empty("main") and not minetest.is_protected(pos, name) return inv:is_empty("main") and not minetest.is_protected(pos, name)
end, end,
on_timer = function()--pos, elapsed)
-- restart timer
return true
end,
on_receive_fields = function(pos, _, fields, sender) on_receive_fields = function(pos, _, fields, sender)
--local meta = minetest.get_meta(pos);
if not sender then if not sender then
return return
end end
@ -111,12 +97,10 @@ minetest.register_node("digibuilder:digibuilder", {
return return
end end
if fields.set_digiline_channel then if fields.set_digiline_channel then
local meta = minetest.get_meta(pos); local meta = minetest.get_meta(pos);
meta:set_string("channel", fields.digiline_channel or "") meta:set_string("channel", fields.digiline_channel or "")
end end
end, end,
-- inventory protection -- inventory protection