Version 0.41.3
[MineClone/MineClone2/MineClone2-Fixes.git] / mods / ITEMS / mcl_wool / init.lua
blobe0d0e849045656a590c92ac257636501dcd2bd7b
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")
7 local wool = {}
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.
11 wool.dyes = {
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
31 local name = row[1]
32 local texture = row[2]
33 local desc = row[3]
34 local dye = row[4]
35 local color_group = row[5]
36 -- Node Definition
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.",
40 stack_max = 64,
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(),
45 _mcl_hardness = 0.8,
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(),
58 paramtype = "light",
59 sunlight_propagates = true,
60 stack_max = 64,
61 drawtype = "nodebox",
62 node_box = {
63 type = "fixed",
64 fixed = {
65 {-8/16, -8/16, -8/16, 8/16, -7/16, 8/16},
68 _mcl_hardness = 0.1,
69 _mcl_blast_resistance = 0.5,
71 if dye then
72 -- Crafting from dye and white wool
73 minetest.register_craft({
74 type = "shapeless",
75 output = 'mcl_wool:'..name,
76 recipe = {"mcl_dye:"..dye, 'mcl_wool:white'},
78 end
79 minetest.register_craft({
80 output = 'mcl_wool:'..name..'_carpet 3',
81 recipe = {{'mcl_wool:'..name, 'mcl_wool:'..name}},
83 end
85 minetest.register_craft({
86 output = "mcl_wool:white",
87 recipe = {
88 { "mcl_mobitems:string", "mcl_mobitems:string" },
89 { "mcl_mobitems:string", "mcl_mobitems:string" },
93 minetest.register_craft({
94 type = "fuel",
95 recipe = "group:wool",
96 burntime = 5,
98 minetest.register_craft({
99 type = "fuel",
100 recipe = "group:carpet",
101 -- Original value: 3.35
102 burntime = 3,