Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • Illuna-Minetest/ethereal
1 result
Show changes
Commits on Source (1)
......@@ -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
......