Prevent cave generation in the air
parent
d111364b0f
commit
2809346af8
13
init.lua
13
init.lua
|
@ -625,14 +625,17 @@ function internal.generate_caves(data, minp, maxp)
|
||||||
internal.humidity_noise_params(), bminp, bmaxp
|
internal.humidity_noise_params(), bminp, bmaxp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
local air = minetest.get_content_id("air")
|
||||||
|
|
||||||
-- Place blocks where necessary
|
-- Place blocks where necessary
|
||||||
internal.iter_3d_area(bminp, bmaxp, function (i, pos)
|
internal.iter_3d_area(bminp, bmaxp, function (i, pos)
|
||||||
|
|
||||||
local function place(name)
|
local function place(name)
|
||||||
if type(name) == "string" then
|
local vi = vmanip:pos_to_index(pos)
|
||||||
vmanip:set_index(
|
|
||||||
vmanip:pos_to_index(pos),
|
if vmanip:get_index(vi) == air then
|
||||||
minetest.get_content_id(name)
|
elseif type(name) == "string" then
|
||||||
)
|
vmanip:set_index(vi, minetest.get_content_id(name))
|
||||||
elseif type(name) == "nil" then
|
elseif type(name) == "nil" then
|
||||||
else
|
else
|
||||||
error("Inserted invalid type " .. type(name) .. " into voxelmanip array")
|
error("Inserted invalid type " .. type(name) .. " into voxelmanip array")
|
||||||
|
|
Loading…
Reference in New Issue