mirror of
				https://github.com/mt-mods/plantlife_modpack.git
				synced 2025-10-31 13:55:25 +01:00 
			
		
		
		
	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 | 	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) | ||||||
| 		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, | 	end, | ||||||
| }) | }) | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user