forked from mtcontrib/plantlife_modpack
		
	Make short grass convert to dirt with grass only after cut grass/hay was removed
This commit is contained in:
		@@ -190,7 +190,11 @@ minetest.register_abm({
 | 
			
		||||
	interval = GRASS_REGROWING_TIME, --1200, -- 20 minutes: a minetest-day/night-cycle
 | 
			
		||||
	chance = 100/GRASS_REGROWING_CHANCE,
 | 
			
		||||
	action = function(pos)
 | 
			
		||||
		minetest.set_node(pos, {name="default:dirt_with_grass"})
 | 
			
		||||
		-- 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"})
 | 
			
		||||
		end
 | 
			
		||||
	end,
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user