1 -- minetest/wool/init.lua
3 -- Backwards compatibility with jordach's 16-color wool mod
4 minetest
.register_alias("mcl_wool:dark_blue", "wool:blue")
5 minetest
.register_alias("mcl_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", "White", nil, "basecolor_white"},
13 {"grey", "dark_grey", "Grey", "dark_grey", "unicolor_darkgrey"},
14 {"silver", "grey", "Light Grey", "grey", "basecolor_grey"},
15 {"black", "black", "Black", "black", "basecolor_black"},
16 {"red", "red", "Red", "red", "basecolor_red"},
17 {"yellow", "yellow", "Yellow", "yellow", "basecolor_yellow"},
18 {"green", "green", "Green", "dark_green", "unicolor_dark_green"},
19 {"cyan", "cyan", "Cyan", "cyan", "basecolor_cyan"},
20 {"blue", "blue", "Blue", "blue", "basecolor_blue"},
21 {"magenta", "magenta", "Magenta", "magenta", "basecolor_magenta"},
22 {"orange", "orange", "Orange", "orange", "excolor_orange"},
23 {"purple", "violet", "Purple", "violet", "excolor_violet"},
24 {"brown", "brown", "Brown", "brown", "unicolor_dark_orange"},
25 {"pink", "pink", "Pink", "pink", "unicolor_light_red"},
26 {"lime", "lime", "Lime", "green", "basecolor_green"},
27 {"light_blue", "light_blue", "Light Blue", "lightblue", "unicolor_light_blue"},
30 for _
, row
in ipairs(wool
.dyes
) do
32 local texture
= row
[2]
35 local color_group
= row
[5]
37 minetest
.register_node("mcl_wool:"..name
, {
38 description
= desc
.." Wool",
39 _doc_items_longdesc
= "Wool is a decorational block which comes in many different colors.",
41 is_ground_content
= false,
42 tiles
= {"wool_"..texture
..".png"},
43 groups
= {handy
=1,shearsy_wool
=1, flammable
=1,wool
=1,building_block
=1},
44 sounds
= mcl_sounds
.node_sound_defaults(),
46 _mcl_blast_resistance
= 4,
48 minetest
.register_node("mcl_wool:"..name
.."_carpet", {
49 description
= desc
.." Carpet",
50 _doc_items_longdesc
= "Carpets are thin floor covers which come in many different colors.",
51 walkable
= false, -- See <https://minecraft.gamepedia.com/Materials>
52 is_ground_content
= false,
53 tiles
= {"wool_"..texture
..".png"},
54 wield_image
= "wool_"..texture
..".png",
55 wield_scale
= { x
=1, y
=1, z
=0.5 },
56 groups
= {handy
=1, carpet
=1,attached_node
=1,dig_by_water
=1,deco_block
=1},
57 sounds
= mcl_sounds
.node_sound_defaults(),
59 sunlight_propagates
= true,
65 {-8/16, -8/16, -8/16, 8/16, -7/16, 8/16},
69 _mcl_blast_resistance
= 0.5,
72 -- Crafting from dye and white wool
73 minetest
.register_craft({
75 output
= 'mcl_wool:'..name
,
76 recipe
= {"mcl_dye:"..dye
, 'mcl_wool:white'},
79 minetest
.register_craft({
80 output
= 'mcl_wool:'..name
..'_carpet 3',
81 recipe
= {{'mcl_wool:'..name
, 'mcl_wool:'..name
}},
85 minetest
.register_craft({
86 output
= "mcl_wool:white",
88 { "mcl_mobitems:string", "mcl_mobitems:string" },
89 { "mcl_mobitems:string", "mcl_mobitems:string" },
93 minetest
.register_craft({
95 recipe
= "group:wool",
98 minetest
.register_craft({
100 recipe
= "group:carpet",
101 -- Original value: 3.35