1
0
Fork 0

Regular decorations for legacy nether(except v6)

minetest supports this now
This commit is contained in:
cora 2022-06-18 21:38:20 +02:00
parent 5b366c692d
commit 41f708e03e
2 changed files with 112 additions and 54 deletions

View File

@ -1499,6 +1499,20 @@ local function register_dimension_biomes()
_mcl_biome_type = "hot",
_mcl_palette_index = 17,
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"mcl_nether:netherrack","mcl_nether:glowstone","mcl_blackstone:nether_gold","mcl_nether:quartz_ore","mcl_core:gravel","mcl_nether:soul_sand"},
sidelen = 16,
fill_ratio = 10,
biomes = { "Nether" },
y_min = -31000,
y_max = mcl_vars.mg_nether_max,
decoration = "mcl_nether:netherrack",
flags = "all_floors",
param2 = 0,
})
minetest.register_biome({
name = "SoulsandValley",
node_filler = "mcl_nether:netherrack",
@ -4100,6 +4114,51 @@ end
-- Decorations in non-Overworld dimensions
local function register_dimension_decorations()
--[[ NETHER ]]
--NETHER WASTES (Nether)
minetest.register_decoration({
deco_type = "simple",
place_on = {"mcl_nether:netherrack","mcl_nether:magma"},
sidelen = 16,
fill_ratio = 0.04,
biomes = {"Nether"},
y_min = mcl_vars.mg_lava_nether_max + 1,
y_max = mcl_vars.mg_nether_max - 1,
flags = "all_floors",
decoration = "mcl_fire:eternal_fire",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"mcl_nether:netherrack"},
sidelen = 16,
fill_ratio = 0.013,
biomes = {"Nether"},
y_min = mcl_vars.mg_lava_nether_max + 1,
y_max = mcl_vars.mg_nether_max - 1,
flags = "all_floors",
decoration = "mcl_mushrooms:mushroom_brown",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"mcl_nether:netherrack"},
sidelen = 16,
fill_ratio = 0.012,
biomes = {"Nether"},
y_min = mcl_vars.mg_lava_nether_max + 1,
y_max = mcl_vars.mg_nether_max - 1,
flags = "all_floors",
decoration = "mcl_mushrooms:mushroom_red",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"mcl_nether:soul_sand"},
sidelen = 16,
fill_ratio = 0.0032,
biomes = {"Nether","SoulsandValley"},
y_min = mcl_vars.mg_lava_nether_max + 1,
y_max = mcl_vars.mg_nether_max - 1,
flags = "all_floors",
decoration = "mcl_nether:nether_wart",
})
-- WARPED FOREST
minetest.register_decoration({
@ -4109,7 +4168,7 @@ local function register_dimension_decorations()
fill_ratio = 0.02,
biomes = {"WarpedForest"},
y_min = mcl_vars.mg_lava_nether_max + 1,
y_max = mcl_vars.mg_lava_nether_max - 10,
y_max = mcl_vars.mg_nether_max - 10,
flags = "all_floors",
decoration = "mcl_crimson:warped_fungus",
})

View File

@ -1754,70 +1754,69 @@ else
nether_wart_chance = 170
end
-- Generate Nether decorations manually: Eternal fire, mushrooms, nether wart
-- Minetest's API does not support decorations in caves yet. :-(
-- (only v6)
local function generate_nether_decorations(minp, maxp, seed)
local pr_nether = PseudoRandom(seed+667)
if mg_name == "v6" then
local pr_nether = PseudoRandom(seed+667)
if minp.y > mcl_vars.mg_nether_max or maxp.y < mcl_vars.mg_nether_min then
return
end
minetest.log("action", "[mcl_mapgen_core] Nether decorations " .. minetest.pos_to_string(minp) .. " ... " .. minetest.pos_to_string(maxp))
-- TODO: Generate everything based on Perlin noise instead of PseudoRandom
local bpos
local rack = minetest.find_nodes_in_area_under_air(minp, maxp, {"mcl_nether:netherrack"})
local magma = minetest.find_nodes_in_area_under_air(minp, maxp, {"mcl_nether:magma"})
local ssand = minetest.find_nodes_in_area_under_air(minp, maxp, {"mcl_nether:soul_sand"})
-- Helper function to spawn “fake” decoration
local function special_deco(nodes, spawn_func)
for n = 1, #nodes do
bpos = {x = nodes[n].x, y = nodes[n].y + 1, z = nodes[n].z }
spawn_func(bpos)
if minp.y > mcl_vars.mg_nether_max or maxp.y < mcl_vars.mg_nether_min then
return
end
end
minetest.log("action", "[mcl_mapgen_core] Nether decorations " .. minetest.pos_to_string(minp) .. " ... " .. minetest.pos_to_string(maxp))
-- Eternal fire on netherrack
special_deco(rack, function(bpos)
-- Eternal fire on netherrack
if pr_nether:next(1,100) <= 3 then
minetest.set_node(bpos, {name = "mcl_fire:eternal_fire"})
end
end)
-- TODO: Generate everything based on Perlin noise instead of PseudoRandom
-- Eternal fire on magma cubes
special_deco(magma, function(bpos)
if pr_nether:next(1,150) == 1 then
minetest.set_node(bpos, {name = "mcl_fire:eternal_fire"})
end
end)
local bpos
local rack = minetest.find_nodes_in_area_under_air(minp, maxp, {"mcl_nether:netherrack"})
local magma = minetest.find_nodes_in_area_under_air(minp, maxp, {"mcl_nether:magma"})
local ssand = minetest.find_nodes_in_area_under_air(minp, maxp, {"mcl_nether:soul_sand"})
-- Mushrooms on netherrack
-- Note: Spawned *after* the fire because of light level checks
special_deco(rack, function(bpos)
local l = minetest.get_node_light(bpos, 0.5)
if bpos.y > mcl_vars.mg_lava_nether_max + 6 and l and l <= 12 and pr_nether:next(1,1000) <= 4 then
-- TODO: Make mushrooms appear in groups, use Perlin noise
if pr_nether:next(1,2) == 1 then
minetest.set_node(bpos, {name = "mcl_mushrooms:mushroom_brown"})
else
minetest.set_node(bpos, {name = "mcl_mushrooms:mushroom_red"})
-- Helper function to spawn “fake” decoration
local function special_deco(nodes, spawn_func)
for n = 1, #nodes do
bpos = {x = nodes[n].x, y = nodes[n].y + 1, z = nodes[n].z }
spawn_func(bpos)
end
end
end)
-- Eternal fire on netherrack
special_deco(rack, function(bpos)
-- Eternal fire on netherrack
if pr_nether:next(1,100) <= 3 then
minetest.set_node(bpos, {name = "mcl_fire:eternal_fire"})
end
end)
-- Nether wart on soul sand
-- TODO: Spawn in Nether fortresses
special_deco(ssand, function(bpos)
if pr_nether:next(1, nether_wart_chance) == 1 then
minetest.set_node(bpos, {name = "mcl_nether:nether_wart"})
end
end)
-- Eternal fire on magma cubes
special_deco(magma, function(bpos)
if pr_nether:next(1,150) == 1 then
minetest.set_node(bpos, {name = "mcl_fire:eternal_fire"})
end
end)
-- Mushrooms on netherrack
-- Note: Spawned *after* the fire because of light level checks
special_deco(rack, function(bpos)
local l = minetest.get_node_light(bpos, 0.5)
if bpos.y > mcl_vars.mg_lava_nether_max + 6 and l and l <= 12 and pr_nether:next(1,1000) <= 4 then
-- TODO: Make mushrooms appear in groups, use Perlin noise
if pr_nether:next(1,2) == 1 then
minetest.set_node(bpos, {name = "mcl_mushrooms:mushroom_brown"})
else
minetest.set_node(bpos, {name = "mcl_mushrooms:mushroom_red"})
end
end
end)
-- Nether wart on soul sand
-- TODO: Spawn in Nether fortresses
special_deco(ssand, function(bpos)
if pr_nether:next(1, nether_wart_chance) == 1 then
minetest.set_node(bpos, {name = "mcl_nether:nether_wart"})
end
end)
end
end
minetest.register_on_generated(function(minp, maxp, blockseed)