1 local S
= minetest
.get_translator("hades_trees")
3 hades_trees
.register_trunk
= function(id
, def
)
4 minetest
.register_node("hades_trees:"..id
, {
5 description
= def
.description
,
12 {-0.5,-0.5,-3/16, 0.5,0.5,3/16},
13 {-7/16,-0.5,-5/16, 7/16,0.5,5/16},
14 {-6/16,-0.5,-6/16, 6/16,0.5,6/16},
15 {-5/16,-0.5,-7/16, 5/16,0.5,7/16},
16 {-3/16,-0.5,-0.5, 3/16,0.5,0.5},
19 is_ground_content
= false,
20 groups
= {tree
=1,choppy
=2,oddly_breakable_by_hand
=1,flammable
=2},
21 sounds
= hades_sounds
.node_sound_wood_defaults(),
25 hades_trees
.register_bark
= function(id
, def
)
26 minetest
.register_node("hades_trees:"..id
, {
27 description
= def
.description
,
28 paramtype2
= "facedir",
29 tiles
= { def
.image
},
30 is_ground_content
= false,
31 groups
= { bark
=1, choppy
= 3, oddly_breakable_by_hand
= 1, flammable
= 2 },
32 sounds
= hades_sounds
.node_sound_wood_defaults(),
36 hades_trees
.register_sapling
= function(id
, def
)
38 if def
.growtype
== "ash" then
39 tth
= S("Needs Dirt, Fertile Sand or Volcanic Ash to grow, and light")
41 tth
= S("Needs Dirt and light to grow")
43 minetest
.register_node("hades_trees:"..id
, {
44 description
= def
.description
,
46 drawtype
= "plantlike",
48 inventory_image
= def
.image
,
49 wield_image
= def
.image
,
52 is_ground_content
= false,
58 groups
= {snappy
=2,dig_immediate
=3,flammable
=2,attached_node
=1, sapling
=1},
59 sounds
= hades_sounds
.node_sound_leaves_defaults(),
63 hades_trees
.register_leaves
= function(id
, def
)
68 -- player will get sapling with chance of (1/def.drop_rarity)
69 items
= {def
.drop_item
},
70 rarity
= def
.drop_rarity
,
73 -- player will get leaves only if they get no def.drop_item,
74 -- this is because max_items is 1
75 items
= {"hades_trees:"..id
},
79 minetest
.register_node("hades_trees:"..id
, {
80 description
= def
.description
,
81 drawtype
= "allfaces_optional",
85 is_ground_content
= false,
87 groups
= {snappy
=3, leafdecay
=3, flammable
=2, leaves
=1, ash_fertilizer
=def
.ash_fertilizer
, porous
=1},
89 sounds
= hades_sounds
.node_sound_leaves_defaults(),
93 hades_trees
.register_fruit
= function(id
, def
)
94 local sat
= def
.satiation
98 on_use
= minetest
.item_eat(sat
)
100 local groups
= {dig_immediate
=3,flammable
=2,leafdecay
=3,leafdecay_drop
=1,food
=food
,eatable
=sat
}
102 for k
,v
in pairs(def
.groups
) do
109 minetest
.register_node("hades_trees:"..id
, {
110 description
= def
.description
,
111 drawtype
= def
.drawtype
,
113 inventory_image
= def
.image
,
114 wield_image
= def
.image
,
116 sunlight_propagates
= true,
118 is_ground_content
= false,
126 sounds
= hades_sounds
.node_sound_leaves_defaults(),