local modname = minetest.get_current_modname() local modpath = minetest.get_modpath (modname) -- This uses a trick: you can first define the recipes using all of the base -- colors, and then some recipes using more specific colors for a few non-base -- colors available. When crafting, the last recipes will be checked first. local glow_wool_all = ocutil.bool_default ("glowwool" ) or ocutil.bool_default ("woolglow" ) or ocutil.bool_default ("glow_wool_all" ) or ocutil.bool_default ("glow_all_wool" ) local dyes = { {"white", "White", "basecolor_white" , 9 } , {"grey", "Grey", "basecolor_grey" , 13 } , {"black", "Black", "basecolor_black" , 13 } , {"red", "Red", "basecolor_red" , 13 } , {"yellow", "Yellow", "basecolor_yellow" , 9 } , {"green", "Green", "basecolor_green" , 9 } , {"cyan", "Cyan", "basecolor_cyan" , 13 } , {"blue", "Blue", "basecolor_blue" , 13 } , {"magenta", "Magenta", "basecolor_magenta" , 13 } , {"orange", "Orange", "excolor_orange" , 13 } , {"violet", "Violet", "excolor_violet" , 13 } , {"brown", "Brown", "unicolor_dark_orange" , 13 } , {"pink", "Pink", "unicolor_light_red" , 10 } , {"dark_grey", "Dark Grey", "unicolor_darkgrey" , 13 } , {"dark_green", "Dark Green", "unicolor_dark_green" , 11 } , } for i = 1, #dyes do local name, desc, craft_color_group, glow = unpack (dyes [i]) local params1 = { description = desc .. " Wool", tiles = {"wool_" .. name .. ".png"}, is_ground_content = false, groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 3, flammable = 3, wool = 1}, sounds = default.node_sound_defaults(), } if glow_wool_all then params1.light_source = glow params1.paramtype = "light" end local params2 = ocutil.clone_table (params1) params2.description = desc .. " Glow Wool" params2.light_source = glow params2.paramtype = "light" minetest.register_node ("wool:" .. name, params1) minetest.register_node ("wool:glow_" .. name, params2) minetest.register_craft { type = "shapeless", output = "wool:" .. name, recipe = {"group:dye," .. craft_color_group, "group:wool"}, } end -- Backwards compatibility with Jordach's 16-color wool mod minetest.register_alias("wool:dark_blue", "wool:blue") minetest.register_alias("wool:gold", "wool:yellow") -- =================================================================== if ocutil.mod_exists ("stairs") then dofile (modpath .. "/wool_stairs.lua") end