Fix floating saplings
[minetest_hades/hades_revisited.git] / mods / hades_trees / cjtree.lua
blob8b7a783e0a97f704074627c4536258aef4683f8d
1 local S = minetest.get_translator("hades_trees")
3 minetest.register_node("hades_trees:cultivated_jungle_leaves", {
4 description = S("Cultivated Jungle Leaves"),
5 drawtype = "allfaces_optional",
6 tiles = {"hades_trees_cultivated_jungle_leaves.png"},
7 paramtype = "light",
8 waving = 1,
9 is_ground_content = false,
10 place_param2 = 1,
11 groups = {snappy=3, leafdecay=3, flammable=2, leaves=1, porous=1},
12 drop = {
13 max_items = 1,
14 items = {
16 -- player will get sapling with 1/20 chance
17 items = {'hades_trees:cultivated_jungle_sapling'},
18 rarity = 25,
21 -- player will get leaves only if he get no saplings,
22 -- this is because max_items is 1
23 items = {'hades_trees:cultivated_jungle_leaves'},
27 sounds = hades_sounds.node_sound_leaves_defaults(),
30 minetest.register_node("hades_trees:cultivated_jungle_sapling", {
31 description = S("Cultivated Jungle Tree Sapling"),
32 _tt_help = S("Needs Dirt and light to grow"),
33 drawtype = "plantlike",
34 tiles = {"hades_trees_cultivated_jungle_sapling.png"},
35 inventory_image = "hades_trees_cultivated_jungle_sapling.png",
36 wield_image = "hades_trees_cultivated_jungle_sapling.png",
37 paramtype = "light",
38 walkable = false,
39 selection_box = {
40 type = "fixed",
41 fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
43 groups = {dig_immediate=3,flammable=2,attached_node=1, sapling=1},
44 sounds = hades_sounds.node_sound_defaults(),
47 minetest.register_abm({
48 nodenames = {"hades_trees:cultivated_jungle_sapling"},
49 interval = 60,
50 chance = 20,
51 action = function(pos, node)
52 hades_trees:generate_cjtree(pos, "hades_trees:jungle_tree", "hades_trees:cultivated_jungle_leaves", {"hades_core:dirt", "hades_core:dirt_with_grass"})
53 end