Crafter/mods/main/grass_spread.lua

18 lines
387 B
Lua
Raw Normal View History

2020-02-22 12:25:40 -05:00
--grass spread abm
minetest.register_abm({
2020-03-10 23:56:27 -07:00
label = "Grass Grow",
nodenames = {"main:dirt"},
neighbors = {"main:grass"},
interval = 10,
chance = 2000,
action = function(pos)
local light = minetest.get_node_light(pos, nil)
--print(light)
if light < 10 then
--print("failed to grow grass at "..dump(pos))
return
end
minetest.set_node(pos,{name="main:grass"})
end,
2020-02-22 12:25:40 -05:00
})