Grow and decay apples.

This commit is contained in:
Duane 2016-07-10 08:25:31 -05:00
parent 534d48a0bd
commit 159083227d

View file

@ -332,6 +332,29 @@ minetest.register_abm({
-- creation -- creation
------------------------------------------------------------ ------------------------------------------------------------
minetest.register_abm({
nodenames = {"default:leaves"},
interval = 10 * fun_caves.time_factor,
chance = 100,
catch_up = false,
action = function(pos, node)
pos.y = pos.y - 1
local node_below = minetest.get_node_or_nil(pos)
if node_below and node_below.name == 'air' then
minetest.set_node(pos, {name = 'default:apple'})
end
end
})
minetest.register_abm({
nodenames = {"default:apple"},
interval = 1 * fun_caves.time_factor,
chance = 100,
action = function(pos, node)
minetest.remove_node(pos)
end
})
-- Freezing vapor hardens into ice. -- Freezing vapor hardens into ice.
local ice_node = {name = 'default:ice'} local ice_node = {name = 'default:ice'}
minetest.register_abm({ minetest.register_abm({