1 local S
= minetest
.get_translator("mtg_plus")
3 local metal_sounds
, wood_sounds
4 if default
.node_sound_metal_defaults
then
5 metal_sounds
= default
.node_sound_metal_defaults()
7 metal_sounds
= default
.node_sound_stone_defaults()
9 wood_sounds
= default
.node_sound_wood_defaults()
12 minetest
.register_node("mtg_plus:ladder_papyrus", {
13 description
= S("Papyrus Ladder"),
14 _doc_items_longdesc
= S("A particulary strong piece of ladder which allows you to move vertically."),
15 drawtype
= "signlike",
16 tiles
= {"mtg_plus_ladder_papyrus.png"},
17 inventory_image
= "mtg_plus_ladder_papyrus.png",
18 wield_image
= "mtg_plus_ladder_papyrus.png",
20 paramtype2
= "wallmounted",
21 sunlight_propagates
= true,
24 is_ground_content
= false,
25 selection_box
= { type = "wallmounted", },
26 groups
= { snappy
= 2, choppy
= 1, flammable
= 2 },
27 sounds
= default
.node_sound_leaves_defaults(),
30 minetest
.register_craft({
31 output
= "mtg_plus:ladder_papyrus 2",
32 recipe
= { {"default:papyrus", "", "default:papyrus"},
33 {"farming:string", "default:papyrus", "farming:string"},
34 {"default:papyrus", "", "default:papyrus"}},
37 minetest
.register_craft({
39 recipe
= "mtg_plus:ladder_papyrus",
43 local simple_ladders
= {
44 { "gold", "metal", S("Golden Ladder"), "default:gold_ingot", { cracky
= 3 }, true },
45 { "bronze", "metal", S("Bronze Ladder"), "default:bronze_ingot", { cracky
= 2 } },
46 { "copper", "metal", S("Copper Ladder"), "default:copper_ingot", { cracky
= 2 } },
47 { "tin", "metal", S("Tin Ladder"), "default:tin_ingot", { cracky
= 2 } },
48 { "aspen_wood", "wood", S("Aspen Wood Ladder"), "default:aspen_wood", { choppy
= 3, flammable
= 1 }, nil, 5 },
49 { "acacia_wood", "wood", S("Acacia Wood Ladder"), "default:acacia_wood", { choppy
= 3, flammable
= 1 }, nil, 8 },
50 { "pine_wood", "wood", S("Pine Wood Ladder"), "default:pine_wood", { choppy
= 3, flammable
= 1 }, nil, 6 },
51 { "junglewood", "wood", S("Jungle Wood Ladder"), "default:junglewood", { choppy
= 3, flammable
= 1 }, nil, 9 },
52 { "goldwood", "wood", S("Goldwood Ladder"), "mtg_plus:goldwood", { choppy
= 2 }, true },
55 for m
=1, #simple_ladders
do
56 local ladder
= simple_ladders
[m
]
59 longdesc
= S("A luxurious piece of ladder which allows you to move vertically.")
61 longdesc
= S("A piece of ladder which allows you to move vertically.")
63 if ladder
[2] == "metal" then
68 minetest
.register_node("mtg_plus:ladder_"..ladder
[1], {
69 description
= ladder
[3],
70 _doc_items_longdesc
= longdesc
,
71 drawtype
= "signlike",
72 tiles
= {"mtg_plus_ladder_"..ladder
[1]..".png"},
73 inventory_image
= "mtg_plus_ladder_"..ladder
[1]..".png",
74 wield_image
= "mtg_plus_ladder_"..ladder
[1]..".png",
76 paramtype2
= "wallmounted",
77 sunlight_propagates
= true,
80 is_ground_content
= false,
81 selection_box
= { type = "wallmounted", },
85 if ladder
[2] == "metal" then
86 minetest
.register_craft({
87 output
= "mtg_plus:ladder_"..ladder
[1].." 15",
89 {ladder
[4], "", ladder
[4]},
90 {ladder
[4], ladder
[4], ladder
[4]},
91 {ladder
[4], "", ladder
[4]},
95 minetest
.register_craft({
96 output
= "mtg_plus:ladder_"..ladder
[1].." 9",
98 {"group:stick", "", "group:stick"},
99 {"group:stick", ladder
[4], "group:stick"},
100 {"group:stick", "", "group:stick"},
103 if ladder
[7] ~= nil then
104 minetest
.register_craft({
106 recipe
= "mtg_plus:ladder_"..ladder
[1],
107 burntime
= ladder
[7],
113 -- Tweak the default ladder
114 minetest
.override_item("default:ladder_wood", { description
= S("Apple Wood Ladder") })
115 minetest
.register_craft({
116 output
= "default:ladder_wood 9",
118 {"group:stick", "", "group:stick"},
119 {"group:stick", "default:wood", "group:stick"},
120 {"group:stick", "", "group:stick"},
124 -- The default stick-only recipe for default ladder will be intentionally kept for