mirror of
https://github.com/mt-mods/plantlife_modpack.git
synced 2024-12-27 10:50:24 +01:00
Make short grass convert to dirt with grass only after cut grass/hay was removed
This commit is contained in:
parent
2b56975993
commit
8b2a32ceae
@ -190,7 +190,11 @@ minetest.register_abm({
|
|||||||
interval = GRASS_REGROWING_TIME, --1200, -- 20 minutes: a minetest-day/night-cycle
|
interval = GRASS_REGROWING_TIME, --1200, -- 20 minutes: a minetest-day/night-cycle
|
||||||
chance = 100/GRASS_REGROWING_CHANCE,
|
chance = 100/GRASS_REGROWING_CHANCE,
|
||||||
action = function(pos)
|
action = function(pos)
|
||||||
|
-- Only become dirt with grass if no cut grass or hay lies on top
|
||||||
|
local above = minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z})
|
||||||
|
if above.name ~= "dryplants:grass" and above.name ~= "dryplants:hay" then
|
||||||
minetest.set_node(pos, {name="default:dirt_with_grass"})
|
minetest.set_node(pos, {name="default:dirt_with_grass"})
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user