Generate netherrack under the bedrock ceiling

this is a somewhat ugly hack that uses minetest.generate_decorations
which generates decorations regardless of biome so additional steps
had to be taken to ensure no other decorations "spill over" due to
this.
This commit is contained in:
cora 2022-10-27 19:34:58 +02:00
parent 302b18833a
commit 98dad0b191
4 changed files with 38 additions and 13 deletions

View file

@ -138,6 +138,7 @@ mcl_vars.mg_nether_min = -29067 -- Carefully chosen to be at a mapchunk border
mcl_vars.mg_nether_max = mcl_vars.mg_nether_min + 128 mcl_vars.mg_nether_max = mcl_vars.mg_nether_min + 128
mcl_vars.mg_bedrock_nether_bottom_min = mcl_vars.mg_nether_min mcl_vars.mg_bedrock_nether_bottom_min = mcl_vars.mg_nether_min
mcl_vars.mg_bedrock_nether_top_max = mcl_vars.mg_nether_max mcl_vars.mg_bedrock_nether_top_max = mcl_vars.mg_nether_max
mcl_vars.mg_nether_deco_max = mcl_vars.mg_nether_max -11 -- this is so ceiling decorations don't spill into other biomes as bedrock generation calls minetest.generate_decorations to put netherrack under the bedrock
if not superflat then if not superflat then
mcl_vars.mg_bedrock_nether_bottom_max = mcl_vars.mg_bedrock_nether_bottom_min + 4 mcl_vars.mg_bedrock_nether_bottom_max = mcl_vars.mg_bedrock_nether_bottom_min + 4
mcl_vars.mg_bedrock_nether_top_min = mcl_vars.mg_bedrock_nether_top_max - 4 mcl_vars.mg_bedrock_nether_top_min = mcl_vars.mg_bedrock_nether_top_max - 4

View file

@ -1531,6 +1531,23 @@ local function register_dimension_biomes()
--[[ REALMS ]] --[[ REALMS ]]
--[[ THE NETHER ]] --[[ THE NETHER ]]
-- the following decoration is a hack to cover exposed bedrock in netherrack - be careful not to put any ceiling decorations in a way that would apply to this (they would get generated regardless of biome)
minetest.register_decoration({
deco_type = "simple",
place_on = {"mcl_core:bedrock"},
sidelen = 16,
fill_ratio = 10,
biomes = { "Nether" },
y_min = mcl_vars.mg_lava_nether_max,
y_max = mcl_vars.mg_nether_max + 15,
height = 6,
max_height = 10,
decoration = "mcl_nether:netherrack",
flags = "all_ceilings",
param2 = 0,
})
minetest.register_biome({ minetest.register_biome({
name = "Nether", name = "Nether",
node_filler = "mcl_nether:netherrack", node_filler = "mcl_nether:netherrack",
@ -1554,7 +1571,7 @@ local function register_dimension_biomes()
fill_ratio = 10, fill_ratio = 10,
biomes = { "Nether" }, biomes = { "Nether" },
y_min = -31000, y_min = -31000,
y_max = mcl_vars.mg_nether_max, y_max = mcl_vars.mg_nether_deco_max,
decoration = "mcl_nether:netherrack", decoration = "mcl_nether:netherrack",
flags = "all_floors", flags = "all_floors",
param2 = 0, param2 = 0,
@ -1583,7 +1600,7 @@ local function register_dimension_biomes()
fill_ratio = 10, fill_ratio = 10,
biomes = { "SoulsandValley" }, biomes = { "SoulsandValley" },
y_min = -31000, y_min = -31000,
y_max = mcl_vars.mg_nether_max, y_max = mcl_vars.mg_nether_deco_max,
decoration = "mcl_blackstone:soul_soil", decoration = "mcl_blackstone:soul_soil",
flags = "all_floors, all_ceilings", flags = "all_floors, all_ceilings",
param2 = 0, param2 = 0,
@ -1598,7 +1615,7 @@ local function register_dimension_biomes()
clust_size = 15, clust_size = 15,
biomes = { "SoulsandValley" }, biomes = { "SoulsandValley" },
y_min = mcl_vars.mg_nether_min, y_min = mcl_vars.mg_nether_min,
y_max = mcl_vars.mg_nether_max + 80, y_max = mcl_vars.mg_nether_deco_max,
noise_params = { noise_params = {
offset = 0, offset = 0,
scale = 1, scale = 1,
@ -1633,7 +1650,7 @@ local function register_dimension_biomes()
fill_ratio = 10, fill_ratio = 10,
biomes = { "CrimsonForest" }, biomes = { "CrimsonForest" },
y_min = -31000, y_min = -31000,
y_max = mcl_vars.mg_nether_max, y_max = mcl_vars.mg_nether_deco_max,
decoration = "mcl_crimson:crimson_nylium", decoration = "mcl_crimson:crimson_nylium",
flags = "all_floors", flags = "all_floors",
param2 = 0, param2 = 0,
@ -1660,7 +1677,7 @@ local function register_dimension_biomes()
fill_ratio = 10, fill_ratio = 10,
biomes = { "WarpedForest" }, biomes = { "WarpedForest" },
y_min = -31000, y_min = -31000,
y_max = mcl_vars.mg_nether_max, y_max = mcl_vars.mg_nether_deco_max,
decoration = "mcl_crimson:warped_nylium", decoration = "mcl_crimson:warped_nylium",
flags = "all_floors", flags = "all_floors",
param2 = 0, param2 = 0,
@ -1688,7 +1705,7 @@ local function register_dimension_biomes()
fill_ratio = 10, fill_ratio = 10,
biomes = { "BasaltDelta" }, biomes = { "BasaltDelta" },
y_min = -31000, y_min = -31000,
y_max = mcl_vars.mg_nether_max, y_max = mcl_vars.mg_nether_deco_max,
decoration = "mcl_blackstone:basalt", decoration = "mcl_blackstone:basalt",
flags = "all_floors", flags = "all_floors",
param2 = 0, param2 = 0,
@ -1703,7 +1720,7 @@ local function register_dimension_biomes()
clust_size = 20, clust_size = 20,
biomes = { "BasaltDelta" }, biomes = { "BasaltDelta" },
y_min = mcl_vars.mg_nether_min, y_min = mcl_vars.mg_nether_min,
y_max = mcl_vars.mg_nether_max + 80, y_max = mcl_vars.mg_nether_deco_max,
noise_params = { noise_params = {
offset = 0, offset = 0,
scale = 1, scale = 1,
@ -4903,7 +4920,7 @@ local function register_dimension_decorations()
fill_ratio = 0.063, fill_ratio = 0.063,
biomes = {"CrimsonForest"}, biomes = {"CrimsonForest"},
y_min = mcl_vars.mg_lava_nether_max + 1, y_min = mcl_vars.mg_lava_nether_max + 1,
y_max = mcl_vars.mg_nether_max -5, y_max = mcl_vars.mg_nether_deco_max,
flags = "all_ceilings", flags = "all_ceilings",
height = 2, height = 2,
height_max = 8, height_max = 8,

View file

@ -15,7 +15,7 @@ minetest.register_on_generated(function(minp, maxp, blockseed)
local t1 = os.clock() local t1 = os.clock()
local p1, p2 = {x=minp.x, y=minp.y, z=minp.z}, {x=maxp.x, y=maxp.y, z=maxp.z} local p1, p2 = {x=minp.x, y=minp.y, z=minp.z}, {x=maxp.x, y=maxp.y, z=maxp.z}
if lvm > 0 then if lvm > 0 then
local lvm_used, shadow, deco_used = false, false, false local lvm_used, shadow, deco_used, deco_table = false, false, false, false
local lb2 = {} -- param2 local lb2 = {} -- param2
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip") local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
local e1, e2 = {x=emin.x, y=emin.y, z=emin.z}, {x=emax.x, y=emax.y, z=emax.z} local e1, e2 = {x=emin.x, y=emin.y, z=emin.z}, {x=emax.x, y=emax.y, z=emax.z}
@ -35,7 +35,9 @@ minetest.register_on_generated(function(minp, maxp, blockseed)
if shadow0 then if shadow0 then
shadow = true shadow = true
end end
if deco then if deco and type(deco) == "table" then
deco_table = deco
elseif deco then
deco_used = true deco_used = true
end end
end end
@ -47,7 +49,9 @@ minetest.register_on_generated(function(minp, maxp, blockseed)
if param2 > 0 then if param2 > 0 then
vm:set_param2_data(data2) vm:set_param2_data(data2)
end end
if deco_used then if deco_table then
minetest.generate_decorations(vm,vector.new(minp.x,deco_table.min,minp.z),vector.new(maxp.x,deco_table.max,maxp.z))
elseif deco_used then
minetest.generate_decorations(vm) minetest.generate_decorations(vm)
end end
vm:calc_lighting(p1, p2, shadow) vm:calc_lighting(p1, p2, shadow)

View file

@ -325,8 +325,11 @@ local function world_structure(vm, data, data2, emin, emax, area, minp, maxp, bl
lvm_used = set_layers(data, area, c_nether_lava, c_air, mcl_vars.mg_nether_min, mcl_vars.mg_lava_nether_max, minp, maxp, lvm_used, pr) lvm_used = set_layers(data, area, c_nether_lava, c_air, mcl_vars.mg_nether_min, mcl_vars.mg_lava_nether_max, minp, maxp, lvm_used, pr)
end end
end end
local deco = false
return lvm_used, lvm_used if minp.y > mcl_vars.mg_nether_deco_max - 64 and maxp.y < mcl_vars.mg_nether_max + 128 then
deco = {min=mcl_vars.mg_nether_deco_max,max=mcl_vars.mg_nether_max}
end
return lvm_used, lvm_used, deco
end end
local function block_fixes(vm, data, data2, emin, emax, area, minp, maxp, blockseed) local function block_fixes(vm, data, data2, emin, emax, area, minp, maxp, blockseed)