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 -- name, texture, wool desc., carpet desc., dye, color_group
13 {"white", "wool_white", "White Wool", "White Carpet", nil, "basecolor_white"},
14 {"grey", "wool_dark_grey", "Grey Wool", "Grey Carpet", "dark_grey", "unicolor_darkgrey"},
15 {"silver", "wool_grey", "Light Grey Wool", "Light Grey Carpet", "grey", "basecolor_grey"},
16 {"black", "wool_black", "Black Wool", "Black Carpet", "black", "basecolor_black"},
17 {"red", "wool_red", "Red Wool", "Red Carpet", "red", "basecolor_red"},
18 {"yellow", "wool_yellow", "Yellow Wool", "Yellow Carpet", "yellow", "basecolor_yellow"},
19 {"green", "wool_dark_green", "Green Wool", "Green Carpet", "dark_green", "unicolor_dark_green"},
20 {"cyan", "wool_cyan", "Cyan Wool", "Cyan Carpet", "cyan", "basecolor_cyan"},
21 {"blue", "wool_blue", "Blue Wool", "Blue Carpet", "blue", "basecolor_blue"},
22 {"magenta", "wool_magenta", "Magenta Wool", "Magenta Carpet", "magenta", "basecolor_magenta"},
23 {"orange", "wool_orange", "Orange Wool", "Orange Carpet", "orange", "excolor_orange"},
24 {"purple", "wool_violet", "Purple Wool", "Purple Carpet", "violet", "excolor_violet"},
25 {"brown", "wool_brown", "Brown Wool", "Brown Carpet", "brown", "unicolor_dark_orange"},
26 {"pink", "wool_pink", "Pink Wool", "Pink Carpet", "pink", "unicolor_light_red"},
27 {"lime", "mcl_wool_lime", "Lime Wool", "Lime Carpet", "green", "basecolor_green"},
28 {"light_blue", "mcl_wool_light_blue", "Light Blue Wool", "Light Blue Carpet", "lightblue", "unicolor_light_blue"},
31 for _
, row
in ipairs(wool
.dyes
) do
33 local texture
= row
[2]
34 local desc_wool
= row
[3]
35 local desc_carpet
= row
[4]
37 local color_group
= row
[6]
39 minetest
.register_node("mcl_wool:"..name
, {
40 description
= desc_wool
,
41 _doc_items_longdesc
= "Wool is a decorational block which comes in many different colors.",
43 is_ground_content
= false,
44 tiles
= {texture
..".png"},
45 groups
= {handy
=1,shearsy_wool
=1, flammable
=1,wool
=1,building_block
=1},
46 sounds
= mcl_sounds
.node_sound_defaults(),
48 _mcl_blast_resistance
= 4,
50 minetest
.register_node("mcl_wool:"..name
.."_carpet", {
51 description
= desc_carpet
,
52 _doc_items_longdesc
= "Carpets are thin floor covers which come in many different colors.",
53 walkable
= false, -- See <https://minecraft.gamepedia.com/Materials>
54 is_ground_content
= false,
55 tiles
= {texture
..".png"},
56 wield_image
= texture
..".png",
57 wield_scale
= { x
=1, y
=1, z
=0.5 },
58 groups
= {handy
=1, carpet
=1,attached_node
=1,dig_by_water
=1,deco_block
=1},
59 sounds
= mcl_sounds
.node_sound_defaults(),
61 sunlight_propagates
= true,
67 {-8/16, -8/16, -8/16, 8/16, -7/16, 8/16},
71 _mcl_blast_resistance
= 0.5,
74 -- Crafting from dye and white wool
75 minetest
.register_craft({
77 output
= 'mcl_wool:'..name
,
78 recipe
= {"mcl_dye:"..dye
, 'mcl_wool:white'},
81 minetest
.register_craft({
82 output
= 'mcl_wool:'..name
..'_carpet 3',
83 recipe
= {{'mcl_wool:'..name
, 'mcl_wool:'..name
}},
87 minetest
.register_craft({
88 output
= "mcl_wool:white",
90 { "mcl_mobitems:string", "mcl_mobitems:string" },
91 { "mcl_mobitems:string", "mcl_mobitems:string" },
95 minetest
.register_craft({
97 recipe
= "group:wool",
100 minetest
.register_craft({
102 recipe
= "group:carpet",
103 -- Original value: 3.35