mcl_mapgen_core: Make mcl_ocean an optional dependency.

This commit is contained in:
Daniel Cassidy 2022-01-05 21:34:56 +00:00
parent 012d0bd942
commit b73c0e8f2c
2 changed files with 91 additions and 90 deletions

View File

@ -906,96 +906,97 @@ local function register_mgv6_decorations()
})
-- Seagrass and kelp
local materials = {"dirt","sand"}
for i=1, #materials do
local mat = materials[i]
if minetest.get_modpath("mcl_ocean") then
local materials = {"dirt","sand"}
for i=1, #materials do
local mat = materials[i]
minetest.register_decoration({
deco_type = "simple",
spawn_by = {"group:water"},
num_spawn_by = 1,
place_on = {"mcl_core:"..mat},
sidelen = 8,
noise_params = {
offset = 0.04,
scale = 0.3,
spread = {x = 100, y = 100, z = 100},
seed = 421,
octaves = 3,
persist = 0.6
},
flags = "force_placement",
place_offset_y = -1,
y_min = mcl_vars.overworld_min,
y_max = 0,
decoration = "mcl_ocean:seagrass_"..mat,
})
minetest.register_decoration({
deco_type = "simple",
spawn_by = {"group:water"},
num_spawn_by = 1,
place_on = {"mcl_core:mat"},
sidelen = 8,
noise_params = {
offset = 0.08,
scale = 0.03,
spread = {x = 100, y = 100, z = 100},
seed = 421,
octaves = 3,
persist = 0.6
},
flags = "force_placement",
place_offset_y = -1,
y_min = mcl_vars.overworld_min,
y_max = -5,
decoration = "mcl_ocean:seagrass_"..mat,
})
minetest.register_decoration({
deco_type = "simple",
spawn_by = {"group:water"},
num_spawn_by = 1,
place_on = {"mcl_core:"..mat},
sidelen = 16,
noise_params = {
offset = 0.01,
scale = 0.01,
spread = {x = 300, y = 300, z = 300},
seed = 505,
octaves = 5,
persist = 0.62,
},
flags = "force_placement",
place_offset_y = -1,
y_min = mcl_vars.overworld_min,
y_max = -6,
decoration = "mcl_ocean:kelp_"..mat,
param2 = 16,
param2_max = 96,
})
minetest.register_decoration({
deco_type = "simple",
spawn_by = {"group:water"},
num_spawn_by = 1,
place_on = {"mcl_core:"..mat},
sidelen = 16,
noise_params = {
offset = 0.01,
scale = 0.01,
spread = {x = 100, y = 100, z = 100},
seed = 506,
octaves = 5,
persist = 0.62,
},
flags = "force_placement",
place_offset_y = -1,
y_min = mcl_vars.overworld_min,
y_max = -15,
decoration = "mcl_ocean:kelp_"..mat,
param2 = 32,
param2_max = 160,
})
minetest.register_decoration({
deco_type = "simple",
spawn_by = {"group:water"},
num_spawn_by = 1,
place_on = {"mcl_core:"..mat},
sidelen = 8,
noise_params = {
offset = 0.04,
scale = 0.3,
spread = {x = 100, y = 100, z = 100},
seed = 421,
octaves = 3,
persist = 0.6
},
flags = "force_placement",
place_offset_y = -1,
y_min = mcl_vars.overworld_min,
y_max = 0,
decoration = "mcl_ocean:seagrass_"..mat,
})
minetest.register_decoration({
deco_type = "simple",
spawn_by = {"group:water"},
num_spawn_by = 1,
place_on = {"mcl_core:mat"},
sidelen = 8,
noise_params = {
offset = 0.08,
scale = 0.03,
spread = {x = 100, y = 100, z = 100},
seed = 421,
octaves = 3,
persist = 0.6
},
flags = "force_placement",
place_offset_y = -1,
y_min = mcl_vars.overworld_min,
y_max = -5,
decoration = "mcl_ocean:seagrass_"..mat,
})
minetest.register_decoration({
deco_type = "simple",
spawn_by = {"group:water"},
num_spawn_by = 1,
place_on = {"mcl_core:"..mat},
sidelen = 16,
noise_params = {
offset = 0.01,
scale = 0.01,
spread = {x = 300, y = 300, z = 300},
seed = 505,
octaves = 5,
persist = 0.62,
},
flags = "force_placement",
place_offset_y = -1,
y_min = mcl_vars.overworld_min,
y_max = -6,
decoration = "mcl_ocean:kelp_"..mat,
param2 = 16,
param2_max = 96,
})
minetest.register_decoration({
deco_type = "simple",
spawn_by = {"group:water"},
num_spawn_by = 1,
place_on = {"mcl_core:"..mat},
sidelen = 16,
noise_params = {
offset = 0.01,
scale = 0.01,
spread = {x = 100, y = 100, z = 100},
seed = 506,
octaves = 5,
persist = 0.62,
},
flags = "force_placement",
place_offset_y = -1,
y_min = mcl_vars.overworld_min,
y_max = -15,
decoration = "mcl_ocean:kelp_"..mat,
param2 = 32,
param2_max = 160,
})
end
end
-- Wet Sponge

View File

@ -1,5 +1,5 @@
name = mcl_mapgen_core
author = Wuzzy
description = The core of the MCL2 mapgen
depends = mcl_init, mcl_core, biomeinfo, mcl_worlds, mcl_ocean, mcl_stairs, mcl_monster_eggs, mcl_structures
optional_depends = mclx_core, mcl_cocoas, mcl_sponges
depends = mcl_init, mcl_core, biomeinfo, mcl_worlds, mcl_stairs, mcl_monster_eggs, mcl_structures
optional_depends = mclx_core, mcl_cocoas, mcl_sponges, mcl_ocean