mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-09 13:01:49 +00:00
add chunk_height parameter to place_structures
This commit is contained in:
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue