emerge before geode and surface pool placement

otherwise they can be cut off
This commit is contained in:
cora 2022-07-01 14:43:03 +02:00
parent ef14006f15
commit 6ad00e4170
2 changed files with 86 additions and 78 deletions

View File

@ -17,6 +17,8 @@ local function makegeode(pos,def,pr)
local size = pr:next(5,7) local size = pr:next(5,7)
local p1 = vector.offset(pos,-size,-size,-size) local p1 = vector.offset(pos,-size,-size,-size)
local p2 = vector.offset(pos,size,size,size) local p2 = vector.offset(pos,size,size,size)
minetest.emerge_area(p1, p2, function(blockpos, action, calls_remaining, param)
if calls_remaining ~= 0 then return end
local calcite = {} local calcite = {}
local nn = minetest.find_nodes_in_area(p1,p2,{"group:material_stone"}) local nn = minetest.find_nodes_in_area(p1,p2,{"group:material_stone"})
table.sort(nn,function(a, b) table.sort(nn,function(a, b)
@ -62,6 +64,8 @@ local function makegeode(pos,def,pr)
end end
end end
return true return true
end)
return true
end end
mcl_structures.register_structure("geode",{ mcl_structures.register_structure("geode",{

View File

@ -33,6 +33,8 @@ local function makelake(pos,size,liquid,placein,border,pr)
local node_under = minetest.get_node(vector.offset(pos,0,-1,0)) local node_under = minetest.get_node(vector.offset(pos,0,-1,0))
local p1 = vector.offset(pos,-size,-1,-size) local p1 = vector.offset(pos,-size,-1,-size)
local p2 = vector.offset(pos,size,-1,size) local p2 = vector.offset(pos,size,-1,size)
minetest.emerge_area(p1, p2, function(blockpos, action, calls_remaining, param)
if calls_remaining ~= 0 then return end
local nn = minetest.find_nodes_in_area(p1,p2,placein) local nn = minetest.find_nodes_in_area(p1,p2,placein)
table.sort(nn,function(a, b) table.sort(nn,function(a, b)
return vector.distance(vector.new(pos.x,0,pos.z), a) < vector.distance(vector.new(pos.x,0,pos.z), b) return vector.distance(vector.new(pos.x,0,pos.z), a) < vector.distance(vector.new(pos.x,0,pos.z), b)
@ -79,6 +81,8 @@ local function makelake(pos,size,liquid,placein,border,pr)
minetest.bulk_set_node(br,{name=border}) minetest.bulk_set_node(br,{name=border})
minetest.bulk_set_node(air,{name="air"}) minetest.bulk_set_node(air,{name="air"})
return true return true
end)
return true
end end
mcl_structures.register_structure("lavapool",{ mcl_structures.register_structure("lavapool",{