diff --git a/init.lua b/init.lua index 862ca19..31c2451 100644 --- a/init.lua +++ b/init.lua @@ -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