Commit 4410a1f9 authored by Milan's avatar Milan
Browse files

stop destroying dirt_with_grass

parent 0e03349c
......@@ -89,17 +89,17 @@ dirts = {
-- check surrounding grass and change dirt to same colour
local grass_spread = function(pos, node)
-- not enough light
local above = {x = pos.x, y = pos.y + 1, z = pos.z}
-- not enough light
if (minetest.get_node_light(above) or 0) < 13 then
return
end
-- water above grass
local name = minetest.get_node(above).name
local def = minetest.registered_nodes[name]
-- water above grass
if name == "ignore" or not def or def.liquidtype ~= "none" then
return
end
......@@ -109,10 +109,7 @@ local grass_spread = function(pos, node)
-- find all default and ethereal grasses in area around dirt
local positions, grasses = minetest.find_nodes_in_area(
{x = pos.x - 1, y = pos.y - 2, z = pos.z - 1},
{x = pos.x + 1, y = pos.y + 2, z = pos.z + 1},
-- {"group:ethereal_grass", "default:dirt_with_grass",
-- "default:dirt_with_dry_grass", "default:dirt_with_snow"})
dirts)
{x = pos.x + 1, y = pos.y + 2, z = pos.z + 1}, dirts)
-- count new grass nodes
for n = 1, #dirts do
......@@ -130,11 +127,6 @@ local grass_spread = function(pos, node)
return
end
-- change default green grass to ethereal green grass
if curr_type == "default:dirt_with_grass" then
curr_type = "ethereal:green_dirt"
end
minetest.swap_node(pos, {name = curr_type})
end
......@@ -304,7 +296,7 @@ for _, ab in pairs(minetest.registered_abms) do
--ab.interval = 2
--ab.chance = 1
ab.nodenames = {"default:dirt_with_grass", "default:dirt"}
ab.nodenames = {"default:dirt"}
ab.neighbors = {"air"}
ab.action = grass_spread
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment