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
|
||||
)
|
||||
|
||||
local air = minetest.get_content_id("air")
|
||||
|
||||
-- Place blocks where necessary
|
||||
internal.iter_3d_area(bminp, bmaxp, function (i, pos)
|
||||
|
||||
local function place(name)
|
||||
if type(name) == "string" then
|
||||
vmanip:set_index(
|
||||
vmanip:pos_to_index(pos),
|
||||
minetest.get_content_id(name)
|
||||
)
|
||||
local vi = vmanip:pos_to_index(pos)
|
||||
|
||||
if vmanip:get_index(vi) == air then
|
||||
elseif type(name) == "string" then
|
||||
vmanip:set_index(vi, minetest.get_content_id(name))
|
||||
elseif type(name) == "nil" then
|
||||
else
|
||||
error("Inserted invalid type " .. type(name) .. " into voxelmanip array")
|
||||
|
|
Loading…
Reference in New Issue