Add thread flexibility for cavegen

main
Bram van den Heuvel 2024-09-15 22:33:29 +02:00
parent 13b9e9625f
commit ab695af456
1 changed files with 14 additions and 4 deletions

View File

@ -63,9 +63,7 @@ function internal.init()
internal.overworld_depth_to(WORLD_DEPTH)
-- Add custom caves
minetest.register_mapgen_script(
minetest.get_modpath(minetest.get_current_modname()) .. "/mapgen.lua"
)
internal.add_custom_caves("mapgen.lua")
-- Remove massive v7 caves
internal.stop_v7_caverns()
@ -111,7 +109,19 @@ function internal.init()
internal.spawn_osmium_ore()
-- Add more dripstone blocks
internal.register_dripstone_blocks()
-- internal.register_dripstone_blocks()
end
-- Start the cave generator
function internal.add_custom_caves(filename)
local fullname = minetest.get_modpath(minetest.get_current_modname()) .. "/" .. filename
if ns_cavegen_init and ns_cavegen_init.register_cavegen_script then
ns_cavegen_init.register_cavegen_script(fullname)
else
minetest.log("warning", "User uses deprecated version 1.0.0 of cave generator - please update soon.")
minetest.register_mapgen_script(fullname)
end
end
-- Create a deepcopy of a table