implement inter-chunk structure generation

This commit is contained in:
MihailRis
2024-09-21 20:50:12 +03:00
parent 03ba7c9539
commit a413c5d09e
5 changed files with 67 additions and 9 deletions
+7 -4
View File
@@ -68,10 +68,13 @@ end
function place_structures(x, z, w, d, seed)
local placements = {}
local px = math.random() * w
local py = 200;
local pz = math.random() * d
table.insert(placements, {0, {px, py, pz}})
local hmap = generate_heightmap(x, z, w, d, seed)
for i=0,math.floor(math.random()*3)+5 do
local px = math.random() * w
local pz = math.random() * d
local py = hmap:at(px, pz) * 256
table.insert(placements, {0, {px-8, py, pz-8}})
end
return placements
end