Update helptext of obsidian
[MineClone/MineClone2.git] / mods / ITEMS / mcl_wool / init.lua
blob22648efc9129636c3abba6e86eef3b8c946f73d7
1 local S = minetest.get_translator("mcl_wool")
2 local mod_doc = minetest.get_modpath("doc")
4 -- minetest/wool/init.lua
6 -- Backwards compatibility with jordach's 16-color wool mod
7 minetest.register_alias("mcl_wool:dark_blue", "wool:blue")
8 minetest.register_alias("mcl_wool:gold", "wool:yellow")
10 local wool = {}
11 -- This uses a trick: you can first define the recipes using all of the base
12 -- colors, and then some recipes using more specific colors for a few non-base
13 -- colors available. When crafting, the last recipes will be checked first.
14 wool.dyes = {
15 -- name, texture, wool desc., carpet desc., dye, color_group
16 {"white", "wool_white", S("White Wool"), S("White Carpet"), nil, "unicolor_white"},
17 {"grey", "wool_dark_grey", S("Grey Wool"), S("Grey Carpet"), "dark_grey", "unicolor_darkgrey"},
18 {"silver", "wool_grey", S("Light Grey Wool"), S("Light Grey Carpet"), "grey", "unicolor_grey"},
19 {"black", "wool_black", S("Black Wool"), S("Black Carpet"), "black", "unicolor_black"},
20 {"red", "wool_red", S("Red Wool"), S("Red Carpet"), "red", "unicolor_red"},
21 {"yellow", "wool_yellow", S("Yellow Wool"), S("Yellow Carpet"), "yellow", "unicolor_yellow"},
22 {"green", "wool_dark_green", S("Green Wool"), S("Green Carpet"), "dark_green", "unicolor_dark_green"},
23 {"cyan", "wool_cyan", S("Cyan Wool"), S("Cyan Carpet"), "cyan", "unicolor_cyan"},
24 {"blue", "wool_blue", S("Blue Wool"), S("Blue Carpet"), "blue", "unicolor_blue"},
25 {"magenta", "wool_magenta", S("Magenta Wool"), S("Magenta Carpet"), "magenta", "unicolor_red_violet"},
26 {"orange", "wool_orange", S("Orange Wool"), S("Orange Carpet"), "orange", "unicolor_orange"},
27 {"purple", "wool_violet", S("Purple Wool"), S("Purple Carpet"), "violet", "unicolor_violet"},
28 {"brown", "wool_brown", S("Brown Wool"), S("Brown Carpet"), "brown", "unicolor_dark_orange"},
29 {"pink", "wool_pink", S("Pink Wool"), S("Pink Carpet"), "pink", "unicolor_light_red"},
30 {"lime", "mcl_wool_lime", S("Lime Wool"), S("Lime Carpet"), "green", "unicolor_green"},
31 {"light_blue", "mcl_wool_light_blue", S("Light Blue Wool"), S("Light Blue Carpet"), "lightblue", "unicolor_light_blue"},
33 local canonical_color = "white"
35 for _, row in ipairs(wool.dyes) do
36 local name = row[1]
37 local texture = row[2]
38 local desc_wool = row[3]
39 local desc_carpet = row[4]
40 local dye = row[5]
41 local color_group = row[6]
42 local longdesc_wool, longdesc_carpet, create_entry, name_wool, name_carpet
43 local is_canonical = name == canonical_color
44 if mod_doc then
45 if is_canonical then
46 longdesc_wool = S("Wool is a decorative block which comes in many different colors.")
47 longdesc_carpet = S("Carpets are thin floor covers which come in many different colors.")
48 name_wool = S("Wool")
49 name_carpet = S("Carpet")
50 else
51 create_entry = false
52 end
53 end
54 -- Node Definition
55 minetest.register_node("mcl_wool:"..name, {
56 description = desc_wool,
57 _doc_items_create_entry = create_entry,
58 _doc_items_entry_name = name_wool,
59 _doc_items_longdesc = longdesc_wool,
60 stack_max = 64,
61 is_ground_content = false,
62 tiles = {texture..".png"},
63 groups = {handy=1,shearsy_wool=1, flammable=1,fire_encouragement=30, fire_flammability=60, wool=1,building_block=1,[color_group]=1},
64 sounds = mcl_sounds.node_sound_wool_defaults(),
65 _mcl_hardness = 0.8,
66 _mcl_blast_resistance = 0.8,
68 minetest.register_node("mcl_wool:"..name.."_carpet", {
69 description = desc_carpet,
70 _doc_items_create_entry = create_entry,
71 _doc_items_entry_name = name_carpet,
72 _doc_items_longdesc = longdesc_carpet,
74 walkable = false, -- See <https://minecraft.gamepedia.com/Materials>
75 is_ground_content = false,
76 tiles = {texture..".png"},
77 wield_image = texture..".png",
78 wield_scale = { x=1, y=1, z=0.5 },
79 groups = {handy=1, carpet=1,attached_node=1,flammable=1,fire_encouragement=60, fire_flammability=20, dig_by_water=1,deco_block=1,[color_group]=1},
80 sounds = mcl_sounds.node_sound_wool_defaults(),
81 paramtype = "light",
82 sunlight_propagates = true,
83 stack_max = 64,
84 drawtype = "nodebox",
85 node_box = {
86 type = "fixed",
87 fixed = {
88 {-8/16, -8/16, -8/16, 8/16, -7/16, 8/16},
91 _mcl_hardness = 0.1,
92 _mcl_blast_resistance = 0.1,
94 if mod_doc and not is_canonical then
95 doc.add_entry_alias("nodes", "mcl_wool:"..canonical_color, "nodes", "mcl_wool:"..name)
96 doc.add_entry_alias("nodes", "mcl_wool:"..canonical_color.."_carpet", "nodes", "mcl_wool:"..name.."_carpet")
97 end
98 if dye then
99 -- Crafting from dye and white wool
100 minetest.register_craft({
101 type = "shapeless",
102 output = 'mcl_wool:'..name,
103 recipe = {"mcl_dye:"..dye, 'mcl_wool:white'},
106 minetest.register_craft({
107 output = 'mcl_wool:'..name..'_carpet 3',
108 recipe = {{'mcl_wool:'..name, 'mcl_wool:'..name}},
112 minetest.register_craft({
113 output = "mcl_wool:white",
114 recipe = {
115 { "mcl_mobitems:string", "mcl_mobitems:string" },
116 { "mcl_mobitems:string", "mcl_mobitems:string" },
120 minetest.register_craft({
121 type = "fuel",
122 recipe = "group:wool",
123 burntime = 5,
125 minetest.register_craft({
126 type = "fuel",
127 recipe = "group:carpet",
128 -- Original value: 3.35
129 burntime = 3,