rob_opr_base.lights = {}

minetest.register_tool('rob_opr_base:configurator', {
   description = 'Configurator Wrench',
   inventory_image = 'rob_opr_base_wrench.png',
   on_use = function(itemstack, user, pointed_thing)
      local pos = minetest.get_pointed_thing_position(pointed_thing)
      if pos then
         local name = user:get_player_name()
         local node = minetest.get_node(pos)
         rob_opr_base.config[name] = pos
         if minetest.get_item_group(node.name, 'lights') > 0 then --This needs a way to clear the list.
            local str_pos = minetest.pos_to_string(pos)
            rob_opr_base.lights[name] = rob_opr_base.lights[name] or ''
            rob_opr_base.lights[name] = rob_opr_base.lights[name] .. str_pos
         elseif minetest.get_item_group(node.name, 'configure') > 0 then
            local def = minetest.registered_nodes[node.name]
            def._on_configure(pos, name)
         end
      end
   end,
})
