1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-11-11 04:50:17 +01:00
server-nalc/mods/mff/mff_classic/abms.lua
2016-08-20 21:19:10 +02:00

20 lines
544 B
Lua

local modname = minetest.get_current_modname()
minetest.register_abm({
nodenames = {'default:cherry_sapling', modname .. 'mg_cherry_sapling'},
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})
default.grow_cherry_tree(pos, false, 'default:cherry_tree', 'default:cherry_blossom_leaves')
end,
})