local Ombrellone_list = {
	{ "Red Ombrellone", "red"},
	{ "Orange Ombrellone", "orange"},
    { "Black Ombrellone", "black"},
	{ "Yellow Ombrellone", "yellow"},
	{ "Green Ombrellone", "green"},
	{ "Blue Ombrellone", "blue"},
	{ "Violet Ombrellone", "violet"},
}

for i in ipairs(Ombrellone_list) do
	local ombrellonedesc = Ombrellone_list[i][1]
	local colour = Ombrellone_list[i][2]
    
   minetest.register_node("summer:ombrellone_"..colour.."", {
	    description = ombrellonedesc.."",
	    drawtype = "mesh",
		mesh = "omb_o.obj",
	    tiles = {"ball_"..colour..".png",
	    },	    
        inventory_image = "summer_ombo_"..colour..".png",
	    
        wield_image  = {"summer_ombo_"..colour..".png",
	    },
	    paramtype = "light",
	    paramtype2 = "facedir",
	    sunlight_propagates = true,
	    walkable = false,
	    selection_box = {
	        type = "fixed",
	        fixed = { -0.25, -0.5, -0.25, 0.25,0.5, 0.25 },
	    },
		groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
		--sounds = default.node_sound_glass_defaults(),
        drop = "summer:ombrellone_"..colour.."_ch",        
		on_rightclick = function(pos, node, clicker)
	        node.name = "summer:ombrellone_"..colour.."_ch"
	        minetest.set_node(pos, node)
	    end,
	})


minetest.register_node("summer:ombrellone_"..colour.."_ch", {
	    description = ombrellonedesc.." ch",
	    drawtype = "mesh",
		mesh = "omb_c.obj",
	    tiles = {"ball_"..colour..".png",
	    },
        inventory_image = "summer_ombc_"..colour..".png",
	    
        wield_image  = "summer_ombc_"..colour..".png",
	    
	    paramtype = "light",
	    paramtype2 = "facedir",
	    sunlight_propagates = true,
	    walkable = false,
	    selection_box = {
	        type = "fixed",
	        fixed = { -0.25, -0.5, -0.25, 0.25,0.5, 0.25 },
	    },
		groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3, not_in_creative_inventory=0},
		--sounds = default.node_sound_glass_defaults(),
		drop = "summer:ombrellone_"..colour,
		on_rightclick = function(pos, node, clicker)
	        node.name = "summer:ombrellone_"..colour..""
	        minetest.set_node(pos, node)
	    end,
	})

	minetest.register_craft({
		output = "summer:ombrellone_"..colour.."",
		recipe = {
			{"", "wool:"..colour, "", },
			{"", "cannabis:canapa_plastic", "", },
			{"", "cannabis:canapa_fiber", "", }
		}
	})
	
end
