Present desert stone pyramids in sandy areas

This commit is contained in:
Wuzzy 2019-08-24 20:05:51 +02:00
parent 4300f641dc
commit 4ec1b6b5bc
1 changed files with 7 additions and 0 deletions

View File

@ -327,6 +327,13 @@ minetest.register_on_generated(function(minp, maxp, seed)
if (mg_name == "v6" and sand == "default:desert_sand" and math.random(1, 2) == 1) then
sand = "default:sand"
end
-- Desert stone pyramids only generate in areas with almost no sand
if sand == "default:desert_stone" then
local nodes = minetest.find_nodes_in_area(vector.add(p2, {x=-1, y=-2, z=-1}), vector.add(p2, {x=PYRA_W+1, y=PYRA_Wh, z=PYRA_W+1}), {"group:sand"})
if #nodes > 5 then
sand = "default:desert_sand"
end
end
if sand == "default:desert_sand" then
-- Desert sandstone pyramid
make(p2, "default:desert_sandstone_brick", "default:desert_sandstone", "default:desert_stone", "default:desert_sand", "desert_sandstone")