diff --git a/.luacheckrc b/.luacheckrc index f263b837..afcc2a8f 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -28,7 +28,7 @@ read_globals = { "unifieddyes", "digiline_remote", "drawers", "mg", "craftguide", "i3", "mtt", - "vizlib", "mcl_sounds", + "vizlib", "mcl_sounds", "mcl_vars", -- Only used in technic/machines/MV/lighting.lua (disabled) "isprotect", "homedecor_expect_infinite_stacks", diff --git a/technic_worldgen/mod.conf b/technic_worldgen/mod.conf index f7991cca..10558948 100644 --- a/technic_worldgen/mod.conf +++ b/technic_worldgen/mod.conf @@ -1,3 +1,3 @@ name = technic_worldgen depends = -optional_depends = default, mcl_core, mcl_sounds, mg +optional_depends = default, mcl_core, mcl_sounds, mcl_init, mg diff --git a/technic_worldgen/oregen.lua b/technic_worldgen/oregen.lua index f6fd502c..18d54079 100644 --- a/technic_worldgen/oregen.lua +++ b/technic_worldgen/oregen.lua @@ -1,4 +1,5 @@ +local has_mcl = minetest.get_modpath("mcl_core") local stones = {"default:stone", "mcl_core:stone", "mcl_deepslate:deepslate"} local uranium_params = { @@ -48,8 +49,8 @@ minetest.register_ore({ clust_scarcity = 8*8*8, clust_num_ores = 4, clust_size = 3, - y_min = -300, - y_max = -80, + y_min = has_mcl and mcl_vars.mg_overworld_min or -300, + y_max = has_mcl and -30 or -80, noise_params = uranium_params, noise_threshold = uranium_threshold, }) @@ -61,8 +62,8 @@ minetest.register_ore({ clust_scarcity = 8*8*8, clust_num_ores = 2, clust_size = 3, - y_min = -200, - y_max = -100, + y_min = has_mcl and mcl_vars.mg_overworld_min or -200, + y_max = has_mcl and -30 or -100, noise_params = chromium_params, noise_threshold = chromium_threshold, }) @@ -74,8 +75,8 @@ minetest.register_ore({ clust_scarcity = 6*6*6, clust_num_ores = 2, clust_size = 3, - y_min = -31000, - y_max = -200, + y_min = has_mcl and mcl_vars.mg_overworld_min or -31000, + y_max = has_mcl and -30 or -200, flags = "absheight", noise_params = chromium_params, noise_threshold = chromium_threshold, @@ -101,7 +102,7 @@ minetest.register_ore({ clust_scarcity = 6*6*6, clust_num_ores = 4, clust_size = 3, - y_min = -31000, + y_min = has_mcl and mcl_vars.mg_overworld_min or -31000, y_max = -32, flags = "absheight", noise_params = zinc_params, @@ -128,7 +129,7 @@ minetest.register_ore({ clust_scarcity = 8*8*8, clust_num_ores = 5, clust_size = 3, - y_min = -128, + y_min = has_mcl and mcl_vars.mg_overworld_min or -128, y_max = -16, noise_params = lead_params, noise_threshold = lead_threshold, @@ -141,8 +142,8 @@ minetest.register_ore({ clust_scarcity = 6*6*6, clust_num_ores = 5, clust_size = 3, - y_min = -31000, - y_max = -128, + y_min = has_mcl and mcl_vars.mg_overworld_min or -31000, + y_max = has_mcl and -30 or -128, flags = "absheight", noise_params = lead_params, noise_threshold = lead_threshold, @@ -152,8 +153,6 @@ minetest.register_ore({ local sulfur_buf = {} local sulfur_noise -local has_mcl = minetest.get_modpath("mcl_core") - minetest.register_on_generated(function(minp, maxp) local vm, emin, emax = minetest.get_mapgen_object("voxelmanip") local a = VoxelArea:new({MinEdge=emin, MaxEdge=emax}) @@ -206,8 +205,8 @@ if technic.config:get_bool("enable_marble_generation") then clust_scarcity = 1, clust_num_ores = 1, clust_size = 3, - y_min = -31000, - y_max = -50, + y_min = has_mcl and mcl_vars.mg_overworld_min or -31000, + y_max = has_mcl and -30 or -50, noise_threshold = 0.4, noise_params = { offset = 0, scale = 15, spread = {x = 150, y = 150, z = 150},