1 local S
= minetest
.get_translator("hades_trees")
3 hades_trees
.register_trunk("charred_tree", {
4 description
= S("Charred Tree Trunk"),
6 "hades_trees_charred_tree_top.png",
7 "hades_trees_charred_tree_top.png",
8 "hades_trees_charred_tree.png",
10 sounds
= hades_sounds
.node_sound_wood_defaults({pitch
=0.8}),
12 hades_trees
.register_bark("charred_bark", {
13 description
= S("Charred Bark"),
14 image
= "hades_trees_charred_tree.png",
15 sounds
= hades_sounds
.node_sound_wood_defaults({pitch
=0.8}),
18 hades_trees
.register_leaves("burned_branches", {
19 description
= S("Burned Branches"),
20 image
= "hades_trees_burned_branches.png",
21 sounds
= hades_sounds
.node_sound_straw_defaults(),
22 -- Can survive near any trunk
24 trunk
= "hades_trees:charred_tree",
27 minetest
.register_craft({
28 output
= "hades_core:stick 2",
29 recipe
= {{ "hades_trees:burned_branches" }},
32 minetest
.register_craft({
33 output
= "hades_trees:charred_wood",
34 recipe
= {{ "hades_trees:charred_tree" }},
37 minetest
.register_abm({
38 label
= "Scorch tree trunks and leaves",
39 nodenames
= {"group:tree", "group:leaves"},
40 neighbors
= {"group:lava"},
43 action
= function(pos
, node
)
44 if minetest
.get_item_group(node
.name
, "tree") ~= 0 then
45 if node
.name
~= "hades_trees:charred_tree" then
46 node
.name
= "hades_trees:charred_tree"
47 minetest
.swap_node(pos
, node
)
49 elseif minetest
.get_item_group(node
.name
, "leaves") ~= 0 then
50 if node
.name
~= "hades_trees:burned_branches" then
51 node
.name
= "hades_trees:burned_branches"
52 minetest
.swap_node(pos
, node
)