Compare commits

...

6 Commits

8 changed files with 158 additions and 34 deletions

View File

@ -1578,7 +1578,7 @@ local function register_dimension_biomes()
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"mcl_nether:netherrack","mcl_nether:glowstone"},
place_on = {"mcl_nether:netherrack","mcl_nether:glowstone","mcl_nether:magma"},
sidelen = 16,
fill_ratio = 10,
biomes = { "SoulsandValley" },
@ -1628,7 +1628,7 @@ local function register_dimension_biomes()
})
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"},
place_on = {"mcl_nether:netherrack","mcl_nether:glowstone","mcl_blackstone:nether_gold","mcl_nether:quartz_ore","mcl_core:gravel","mcl_nether:soul_sand","mcl_nether:magma","mcl_blackstone:blackstone"},
sidelen = 16,
fill_ratio = 10,
biomes = { "CrimsonForest" },
@ -1655,7 +1655,7 @@ local function register_dimension_biomes()
})
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"},
place_on = {"mcl_nether:netherrack","mcl_nether:glowstone","mcl_blackstone:nether_gold","mcl_nether:quartz_ore","mcl_core:gravel","mcl_nether:soul_sand","mcl_nether:magma","mcl_blackstone:blackstone"},
sidelen = 16,
fill_ratio = 10,
biomes = { "WarpedForest" },
@ -1681,6 +1681,19 @@ local function register_dimension_biomes()
_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","mcl_blackstone:blackstone","mcl_nether:magma"},
sidelen = 16,
fill_ratio = 10,
biomes = { "BasaltDelta" },
y_min = -31000,
y_max = mcl_vars.mg_nether_max,
decoration = "mcl_blackstone:basalt",
flags = "all_floors",
param2 = 0,
})
minetest.register_ore({
ore_type = "blob",
ore = "mcl_blackstone:blackstone",
@ -1703,19 +1716,6 @@ local function register_dimension_biomes()
}
})
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","mcl_blackstone:blackstone"},
sidelen = 16,
fill_ratio = 10,
biomes = { "BasaltDelta" },
y_min = -31000,
y_max = mcl_vars.mg_nether_max,
decoration = "mcl_blackstone:basalt",
flags = "all_floors",
param2 = 0,
})
--[[ THE END ]]
minetest.register_biome({
name = "End",

View File

@ -104,6 +104,18 @@ if superflat then
minetest.set_mapgen_setting("mgflat_spflags", "nolakes,nohills", true)
end
if mg_name == "v7" then
minetest.set_mapgen_setting("mgv7_cavern_threshold", "0.20", true)
elseif mg_name == "valleys" then
minetest.set_mapgen_setting("mgvalleys_cavern_threshold", "0.20", true)
elseif mg_name == "carpathian" then
minetest.set_mapgen_setting("mgcarpathian_cavern_threshold", "0.20", true)
elseif mg_name == "v5" then
minetest.set_mapgen_setting("mgv5_cavern_threshold", "0.20", true)
elseif mg_name == "fractal" then
minetest.set_mapgen_setting("mgfractal_cavern_threshold", "0.20", true)
end
local mg_flags_str = ""
for k,v in pairs(mg_flags) do
if v == false then

View File

@ -1,29 +1,105 @@
local modname = minetest.get_current_modname()
local S = minetest.get_translator(modname)
local modpath = minetest.get_modpath(modname)
local peaceful = minetest.settings:get_bool("only_peaceful_mobs", false)
mcl_structures.register_structure("nether_outpost",{
place_on = {"mcl_nether:netherrack","mcl_crimson:crimson_nylium","mcl_crimson:warped_nylium","mcl_blackstone:basalt","mcl_blackstone:soul_soil"},
noise_params = {
offset = 0,
scale = 0.00022,
spread = {x = 250, y = 250, z = 250},
seed = 333,
octaves = 1,
persist = 0.0001,
flags = "absvalue",
},
place_on = {"mcl_nether:netherrack","mcl_crimson:crimson_nylium","mcl_crimson:warped_nylium","mcl_blackstone:basalt","mcl_blackstone:soul_soil","mcl_blackstone:blackstone","mcl_nether:soul_sand"},
fill_ratio = 0.01,
chunk_probability = 900,
flags = "all_floors",
biomes = {"Nether","SoulsandValley","WarpedForest","CrimsonForest","BasaltDelta"},
sidelen = 15,
sidelen = 24,
solid_ground = true,
make_foundation = true,
y_min = mcl_vars.mg_lava_nether_max - 1,
y_max = mcl_vars.mg_nether_max - 30,
filenames = { modpath.."/schematics/nether_outpost.mts" },
filenames = { modpath.."/schematics/mcl_nether_fortresses_nether_outpost.mts" },
y_offset = 0,
after_place = function(pos)
local sp = minetest.find_nodes_in_area(pos,vector.offset(pos,0,20,0),{"mcl_mobspawners:spawner"})
if not sp[1] then return end
mcl_mobspawners.setup_spawner(sp[1], "mobs_mc:blaze", 0, minetest.LIGHT_MAX+1, 10, 3, -1)
mcl_mobspawners.setup_spawner(sp[1], "mobs_mc:blaze", 0, minetest.LIGHT_MAX+1, 10, 8, 0)
end
})
mcl_structures.register_structure("nether_bulwark",{
place_on = {"mcl_nether:netherrack","mcl_crimson:crimson_nylium","mcl_crimson:warped_nylium","mcl_blackstone:basalt","mcl_blackstone:soul_soil","mcl_blackstone:blackstone","mcl_nether:soul_sand"},
fill_ratio = 0.01,
chunk_probability = 600,
flags = "all_floors",
biomes = {"Nether","SoulsandValley","WarpedForest","CrimsonForest"},
sidelen = 32,
solid_ground = true,
make_foundation = true,
y_min = mcl_vars.mg_lava_nether_max - 1,
y_max = mcl_vars.mg_nether_max - 30,
filenames = {
modpath.."/schematics/mcl_nether_fortresses_nether_bulwark.mts"
},
daughters = {
[modpath.."/schematics/mcl_nether_fortresses_nether_bulwark_interior_1.mts"] = vector.new(5,0,5),
},
y_offset = 0,
construct_nodes = {"group:wall"},
after_place = function(pos,def,pr)
if not peaceful then
local p1 = vector.offset(pos,-10,0,-10)
local p2 = vector.offset(pos,10,24,10)
local sp = minetest.find_nodes_in_area_under_air(p1,p2,{"mcl_blackstone:blackstone_brick_polished"})
if sp and #sp > 0 then
for i=1,5 do
local pos = vector.offset(sp[pr:next(1,#sp)],0,1,0)
if pos then
minetest.add_entity(pos,"mobs_mc:piglin")
end
end
local pos = vector.offset(sp[pr:next(1,#sp)],0,1,0)
if pos then
minetest.add_entity(pos,"mobs_mc:piglin_brute")
end
end
end
end,
loot = {
["mcl_chests:chest_small" ] ={
{
stacks_min = 1,
stacks_max = 2,
items = {
--{ itemstring = "FIXME:spectral_arrow", weight = 1, amount_min = 10, amount_max=28 },
{ itemstring = "mcl_blackstone:blackstone_gilded", weight = 1, amount_min = 8, amount_max=12 },
{ itemstring = "mcl_core:iron_ingot", weight = 1, amount_min = 4, amount_max=9 },
{ itemstring = "mcl_core:gold_ingot", weight = 1, amount_min = 4, amount_max=9 },
{ itemstring = "mcl_core:crying_obsidian", weight = 1, amount_min = 3, amount_max=8 },
{ itemstring = "mcl_bows:crossbow", weight = 1, func = function(stack, pr)
mcl_enchanting.enchant_uniform_randomly(stack, {"soul_speed"}, pr)
end },
{ itemstring = "mcl_core:goldblock", weight = 1, },
{ itemstring = "mcl_tools:sword_gold", weight = 1, },
{ itemstring = "mcl_tools:axe_gold", weight = 1, func = function(stack, pr)mcl_enchanting.enchant_uniform_randomly(stack, {"soul_speed"}, pr) end },
{ itemstring = "mcl_armor:helmet_gold", weight = 1, func = function(stack, pr)mcl_enchanting.enchant_uniform_randomly(stack, {"soul_speed"}, pr) end },
{ itemstring = "mcl_armor:chestplate_gold", weight = 1, func = function(stack, pr)mcl_enchanting.enchant_uniform_randomly(stack, {"soul_speed"}, pr) end },
{ itemstring = "mcl_armor:leggings_gold", weight = 1, func = function(stack, pr)mcl_enchanting.enchant_uniform_randomly(stack, {"soul_speed"}, pr) end },
{ itemstring = "mcl_armor:boots_gold", weight = 1, func = function(stack, pr)mcl_enchanting.enchant_uniform_randomly(stack, {"soul_speed"}, pr) end },
}
},
{
stacks_min = 2,
stacks_max = 4,
items = {
{ itemstring = "mcl_bows:arrow", weight = 4, amount_min = 5, amount_max=17 },
{ itemstring = "mcl_mobitems:string", weight = 4, amount_min = 1, amount_max=6 },
{ itemstring = "mcl_core:iron_nugget", weight = 1, amount_min = 2, amount_max = 6 },
{ itemstring = "mcl_core:gold_nugget", weight = 1, amount_min = 2, amount_max = 6 },
{ itemstring = "mcl_mobitems:leather", weight = 1, amount_min = 1, amount_max = 3 },
}
},
{
stacks_min = 1,
stacks_max = 1,
items = {
{ itemstring = "mcl_compass:lodestone" },
}
}}
},
})

View File

@ -1,5 +1,11 @@
mcl_structures.registered_structures = {}
local rotations = {
"0",
"90",
"180",
"270"
}
local place_queue = {}
local disabled_structures = minetest.settings:get("mcl_disabled_structures")
if disabled_structures then disabled_structures = disabled_structures:split(",")
else disabled_structures = {} end
@ -140,6 +146,18 @@ local function foundation(ground_p1,ground_p2,pos,sidelen)
minetest.bulk_set_node(stone,{name=node_stone})
end
local function process_queue()
if #place_queue < 1 then return end
local s = table.remove(place_queue)
mcl_structures.place_schematic(s.pos, s.file, s.rot, nil, true, "place_center_x,place_center_z",function(s)
if s.after_place then
s.after_place(s.pos,s.def,s.pr)
end
end,s.pr)
minetest.after(0.5,process_queue)
end
function mcl_structures.place_structure(pos, def, pr, blockseed)
if not def then return end
local log_enabled = logging and not def.terrain_feature
@ -177,12 +195,30 @@ function mcl_structures.place_structure(pos, def, pr, blockseed)
local r = pr:next(1,#def.filenames)
local file = def.filenames[r]
if file then
local rot = rotations[pr:next(1,#rotations)]
local ap = function(pos,def,pr,blockseed) end
if def.after_place then ap = def.after_place end
mcl_structures.place_schematic(pp, file, "random", nil, true, "place_center_x,place_center_z",function(p)
if def.loot then generate_loot(pp,def,pr,blockseed) end
if def.construct_nodes then construct_nodes(pp,def,pr,blockseed) end
if def.daughters then
for fn,p in pairs(def.daughters) do
local p = vector.add(pp,p)
ap = function(pos,def,pr,blockseed)
mcl_structures.place_schematic(pos, fn, rot, nil, true, "place_center_x,place_center_z",function()
if def.loot then generate_loot(pp,def,pr,blockseed) end
if def.construct_nodes then construct_nodes(pp,def,pr,blockseed) end
if def.after_place then
def.after_place(pos,def,pr)
end
--ap(pos,def,pr,blockseed)
end,pr)
end
end
elseif def.after_place then ap = def.after_place
end
mcl_structures.place_schematic(pp, file, rot, nil, true, "place_center_x,place_center_z",function(p)
if not def.daughters then
if def.loot then generate_loot(pp,def,pr,blockseed) end
if def.construct_nodes then construct_nodes(pp,def,pr,blockseed) end
end
return ap(pp,def,pr,blockseed)
end,pr)
if log_enabled then