2016-08-20 21:19:10 +02:00
|
|
|
local modname = minetest.get_current_modname()
|
2016-08-21 15:27:18 +02:00
|
|
|
local thismod = _G[modname]
|
2016-08-20 21:19:10 +02:00
|
|
|
|
|
|
|
minetest.register_abm({
|
2016-08-21 15:27:18 +02:00
|
|
|
nodenames = {modname .. ':cherry_sapling', modname .. 'mg_cherry_sapling'},
|
2016-08-20 21:19:10 +02:00
|
|
|
interval = 80,
|
|
|
|
chance = 3,
|
|
|
|
action = function(pos, node)
|
|
|
|
|
|
|
|
local nu = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name
|
|
|
|
local is_soil = minetest.get_item_group(nu, 'soil')
|
|
|
|
|
|
|
|
if is_soil == 0 then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
minetest.remove_node({x=pos.x, y=pos.y, z=pos.z})
|
2016-08-21 15:27:18 +02:00
|
|
|
thismod.grow_cherry_tree(pos, false, modname .. ':cherry_tree', modname .. ':cherry_blossom_leaves')
|
2016-08-20 21:19:10 +02:00
|
|
|
end,
|
|
|
|
})
|