mirror of
https://github.com/FaceDeer/dfcaverns.git
synced 2025-01-26 18:10:22 +01:00
remove a deprecated API
This commit is contained in:
parent
d51e12a05f
commit
826252225c
19
init.lua
19
init.lua
@ -77,17 +77,18 @@ minetest.register_ore({
|
|||||||
random_factor = 0,
|
random_factor = 0,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------------------------
|
||||||
|
-- Ameliorate lava floods on the surface world by removing lava that's poised to spill
|
||||||
|
|
||||||
local c_air = minetest.get_content_id("air")
|
local c_air = minetest.get_content_id("air")
|
||||||
local c_snowblock = minetest.get_content_id("default:snowblock")
|
local c_snowblock = minetest.get_content_id("default:snowblock")
|
||||||
local c_obsidian = minetest.get_content_id("default:obsidian")
|
local c_obsidian = minetest.get_content_id("default:obsidian")
|
||||||
local c_lava = minetest.get_content_id("default:lava_source")
|
local c_lava = minetest.get_content_id("default:lava_source")
|
||||||
|
|
||||||
local water_level = minetest.get_mapgen_params().water_level
|
local water_level = tonumber(minetest.get_mapgen_setting("water_level"))
|
||||||
|
|
||||||
local is_adjacent_to_air = function(area, data, pos)
|
local is_adjacent_to_air = function(area, data, pos)
|
||||||
return pos.y > water_level and
|
return (data[area:index(pos.x+1, pos.y, pos.z)] == c_air
|
||||||
(data[area:index(pos.x+1, pos.y, pos.z)] == c_air
|
|
||||||
or data[area:index(pos.x-1, pos.y, pos.z)] == c_air
|
or data[area:index(pos.x-1, pos.y, pos.z)] == c_air
|
||||||
or data[area:index(pos.x, pos.y, pos.z+1)] == c_air
|
or data[area:index(pos.x, pos.y, pos.z+1)] == c_air
|
||||||
or data[area:index(pos.x, pos.y, pos.z-1)] == c_air
|
or data[area:index(pos.x, pos.y, pos.z-1)] == c_air
|
||||||
@ -132,10 +133,12 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
for z = z_min, z_max do -- for each xy plane progressing northwards
|
for z = z_min, z_max do -- for each xy plane progressing northwards
|
||||||
--structure loop, hollows out the cavern
|
--structure loop, hollows out the cavern
|
||||||
for y = y_min, y_max do -- for each x row progressing upwards
|
for y = y_min, y_max do -- for each x row progressing upwards
|
||||||
local vi = area:index(x_min, y, z) --current node index
|
if y > water_level then
|
||||||
for x = x_min, x_max do -- for each node do
|
local vi = area:index(x_min, y, z) --current node index
|
||||||
dfcaverns.remove_unsupported_lava(area, data, vi)
|
for x = x_min, x_max do -- for each node do
|
||||||
vi = vi + 1
|
dfcaverns.remove_unsupported_lava(area, data, vi)
|
||||||
|
vi = vi + 1
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -148,4 +151,4 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
vm:update_liquids()
|
vm:update_liquids()
|
||||||
--write it to world
|
--write it to world
|
||||||
vm:write_to_map(data)
|
vm:write_to_map(data)
|
||||||
end)
|
end)
|
Loading…
Reference in New Issue
Block a user