add chunk_height parameter to place_structures

This commit is contained in:
MihailRis
2024-09-29 23:39:42 +03:00
parent abc8eccab8
commit 16fac768c8
4 changed files with 9 additions and 7 deletions
@@ -1,10 +1,10 @@
function place_structures(x, z, w, d, seed, hmap)
function place_structures(x, z, w, d, seed, hmap, chunk_height)
local placements = {}
for i=1,10 do
local sx = math.random() * w
local sz = math.random() * d
local sy = math.random() * 128
if sy < hmap:at(sx, sz) * 256 - 6 then
local sy = math.random() * (chunk_height * 0.5)
if sy < hmap:at(sx, sz) * chunk_height - 6 then
table.insert(placements, {"coal_ore0", {sx, sy, sz}, math.random()*4})
end
end