1 -- minetest/wool/init.lua
3 -- Backwards compatibility with jordach's 16-color wool mod
4 minetest.register_alias("wool:dark_blue", "wool:blue")
5 minetest.register_alias("wool:gold", "wool:yellow")
8 -- This uses a trick: you can first define the recipes using all of the base
9 -- colors, and then some recipes using more specific colors for a few non-base
10 -- colors available. When crafting, the last recipes will be checked first.
12 {"white", "White", "basecolor_white"},
13 {"grey", "Grey", "basecolor_grey"},
14 {"black", "Black", "basecolor_black"},
15 {"red", "Red", "basecolor_red"},
16 {"yellow", "Yellow", "basecolor_yellow"},
17 {"green", "Green", "basecolor_green"},
18 {"cyan", "Cyan", "basecolor_cyan"},
19 {"blue", "Blue", "basecolor_blue"},
20 {"magenta", "Magenta", "basecolor_magenta"},
21 {"orange", "Orange", "excolor_orange"},
22 {"violet", "Violet", "excolor_violet"},
23 {"brown", "Brown", "unicolor_dark_orange"},
24 {"pink", "Pink", "unicolor_light_red"},
25 {"dark_grey", "Dark Grey", "unicolor_darkgrey"},
26 {"dark_green", "Dark Green", "unicolor_dark_green"},
29 for _, row in ipairs(wool.dyes) do
32 local craft_color_group = row[3]
34 minetest.register_node("wool:"..name, {
35 description = desc.." Wool",
36 tiles = {"wool_"..name..".png"},
37 is_ground_content = false,
38 groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3,flammable=3,wool=1},
39 sounds = default.node_sound_defaults(),
41 if craft_color_group then
42 -- Crafting from dye and white wool
43 minetest.register_craft({
45 output = 'wool:'..name,
46 recipe = {'group:dye,'..craft_color_group, 'group:wool'},