1
- -- This uses a trick: you can first define the recipes using all of the base
2
- -- colors, and then some recipes using more specific colors for a few non-base
3
- -- colors available. When crafting, the last recipes will be checked first.
4
-
5
1
local dyes = {
6
- {" white" , " White" , " basecolor_white " },
7
- {" grey" , " Grey" , " basecolor_grey " },
8
- {" black" , " Black" , " basecolor_black " },
9
- {" red" , " Red" , " basecolor_red " },
10
- {" yellow" , " Yellow" , " basecolor_yellow " },
11
- {" green" , " Green" , " basecolor_green " },
12
- {" cyan" , " Cyan" , " basecolor_cyan " },
13
- {" blue" , " Blue" , " basecolor_blue " },
14
- {" magenta" , " Magenta" , " basecolor_magenta " },
15
- {" orange" , " Orange" , " excolor_orange " },
16
- {" violet" , " Violet" , " excolor_violet " },
17
- {" brown" , " Brown" , " unicolor_dark_orange " },
18
- {" pink" , " Pink" , " unicolor_light_red " },
19
- {" dark_grey" , " Dark Grey" , " unicolor_darkgrey " },
20
- {" dark_green" , " Dark Green" , " unicolor_dark_green " },
2
+ {" white" , " White" },
3
+ {" grey" , " Grey" },
4
+ {" black" , " Black" },
5
+ {" red" , " Red" },
6
+ {" yellow" , " Yellow" },
7
+ {" green" , " Green" },
8
+ {" cyan" , " Cyan" },
9
+ {" blue" , " Blue" },
10
+ {" magenta" , " Magenta" },
11
+ {" orange" , " Orange" },
12
+ {" violet" , " Violet" },
13
+ {" brown" , " Brown" },
14
+ {" pink" , " Pink" },
15
+ {" dark_grey" , " Dark Grey" },
16
+ {" dark_green" , " Dark Green" },
21
17
}
22
18
23
19
for i = 1 , # dyes do
24
- local name , desc , craft_color_group = unpack (dyes [i ])
20
+ local name , desc = unpack (dyes [i ])
25
21
26
22
minetest .register_node (" wool:" .. name , {
27
23
description = desc .. " Wool" ,
@@ -35,13 +31,11 @@ for i = 1, #dyes do
35
31
minetest .register_craft {
36
32
type = " shapeless" ,
37
33
output = " wool:" .. name ,
38
- recipe = {" group:dye," .. craft_color_group , " group:wool" },
34
+ recipe = {" group:dye,color_ " .. name , " group:wool" },
39
35
}
40
36
end
41
37
42
-
43
- -- legacy
44
-
38
+ -- Legacy
45
39
-- Backwards compatibility with jordach's 16-color wool mod
46
40
minetest .register_alias (" wool:dark_blue" , " wool:blue" )
47
41
minetest .register_alias (" wool:gold" , " wool:yellow" )
0 commit comments