From 9381657f5d0266d5a9c62dec27c86e1b90869f7f Mon Sep 17 00:00:00 2001 From: cora Date: Fri, 24 Jun 2022 02:11:24 +0200 Subject: [PATCH] use new struct api for desert well and temples --- mods/MAPGEN/mcl_mapgen_core/init.lua | 39 ++---- mods/MAPGEN/mcl_structures/api.lua | 68 +++++---- mods/MAPGEN/mcl_structures/desert_temple.lua | 107 ++++++++++++++ mods/MAPGEN/mcl_structures/init.lua | 131 ++++-------------- mods/MAPGEN/mcl_structures/jungle_temple.lua | 70 ++++++++++ mods/MAPGEN/mcl_structures/mod.conf | 2 +- .../mcl_structures_jungle_temple.mts | Bin 0 -> 2586 bytes .../mcl_structures_jungle_temple_nice.mts | Bin 0 -> 3997 bytes 8 files changed, 255 insertions(+), 162 deletions(-) create mode 100644 mods/MAPGEN/mcl_structures/desert_temple.lua create mode 100644 mods/MAPGEN/mcl_structures/jungle_temple.lua create mode 100644 mods/MAPGEN/mcl_structures/schematics/mcl_structures_jungle_temple.mts create mode 100644 mods/MAPGEN/mcl_structures/schematics/mcl_structures_jungle_temple_nice.mts diff --git a/mods/MAPGEN/mcl_mapgen_core/init.lua b/mods/MAPGEN/mcl_mapgen_core/init.lua index a5a6d7a52..117d8ee09 100644 --- a/mods/MAPGEN/mcl_mapgen_core/init.lua +++ b/mods/MAPGEN/mcl_mapgen_core/init.lua @@ -1262,8 +1262,6 @@ end -- TODO: Try to use more efficient structure generating code local function generate_structures(minp, maxp, blockseed, biomemap) - local chunk_has_desert_well = false - local chunk_has_desert_temple = false local chunk_has_igloo = false local struct_min, struct_max = -3, 111 --64 @@ -1301,32 +1299,8 @@ local function generate_structures(minp, maxp, blockseed, biomemap) local nn0 = minetest.get_node(p).name -- Check if the node can be replaced if minetest.registered_nodes[nn0] and minetest.registered_nodes[nn0].buildable_to then - -- Desert temples and desert wells - if nn == "mcl_core:sand" or (nn == "mcl_core:sandstone") then - if not chunk_has_desert_temple and not chunk_has_desert_well and ground_y > 3 then - -- Spawn desert temple - -- TODO: Check surface - if pr:next(1,12000) == 1 then - mcl_structures.call_struct(p, "desert_temple", nil, pr) - chunk_has_desert_temple = true - end - end - if not chunk_has_desert_temple and not chunk_has_desert_well and ground_y > 3 then - local desert_well_prob = minecraft_chunk_probability(1000, minp, maxp) - - -- Spawn desert well - if pr:next(1, desert_well_prob) == 1 then - -- Check surface - local surface = minetest.find_nodes_in_area({x=p.x,y=p.y-1,z=p.z}, {x=p.x+5, y=p.y-1, z=p.z+5}, "mcl_core:sand") - if #surface >= 25 then - mcl_structures.call_struct(p, "desert_well", nil, pr) - chunk_has_desert_well = true - end - end - end - -- Igloos - elseif not chunk_has_igloo and (nn == "mcl_core:snowblock" or nn == "mcl_core:snow" or (minetest.get_item_group(nn, "grass_block_snow") == 1)) then + if not chunk_has_igloo and (nn == "mcl_core:snowblock" or nn == "mcl_core:snow" or (minetest.get_item_group(nn, "grass_block_snow") == 1)) then if pr:next(1, 4400) == 1 then -- Check surface local floor = {x=p.x+9, y=p.y-1, z=p.z+9} @@ -2211,11 +2185,18 @@ mcl_mapgen_core.register_generator("main", basic, basic_node, 1, true) mcl_mapgen_core.register_generator("structures",nil, function(minp, maxp, blockseed) local gennotify = minetest.get_mapgen_object("gennotify") local pr = PseudoRandom(blockseed + 42) + local has_struct = {} + local poshash = minetest.hash_node_position(minp) for _,struct in pairs(mcl_structures.registered_structures) do + local has = false + if has_struct[struct.name] == nil then has_struct[struct.name] = {} end for _, pos in pairs(gennotify["decoration#"..struct.deco_id] or {}) do - local realpos = vector.offset(pos,0,-1,0) + local realpos = vector.offset(pos,0,1,0) minetest.remove_node(realpos) - mcl_structures.place_structure(realpos,struct,pr) + if struct.chunk_probability ~= nil and not has and pr:next(1,struct.chunk_probability) ~= 1 then + mcl_structures.place_structure(realpos,struct,pr) + has=true + end end end end, 100, true) diff --git a/mods/MAPGEN/mcl_structures/api.lua b/mods/MAPGEN/mcl_structures/api.lua index c0167060b..e2daef96b 100644 --- a/mods/MAPGEN/mcl_structures/api.lua +++ b/mods/MAPGEN/mcl_structures/api.lua @@ -9,16 +9,18 @@ function mcl_structures.place_structure(pos, def, pr) elseif def.y_offset then y_offset = def.y_offset end + local pp = vector.offset(pos,0,y_offset,0) if def.solid_ground and def.sidelen then - local node = minetest.get_node(vector.offset(pos,1,1,0)) + local bn = minetest.get_biome_name(minetest.get_biome_data(pos).biome) + local node_top = minetest.registered_biomes[bn].node_top + local node_fill = minetest.registered_biomes[bn].node_filler local ground_p1 = vector.offset(pos,-def.sidelen/2,-1,-def.sidelen/2) local ground_p2 = vector.offset(pos,def.sidelen/2,-1,def.sidelen/2) local solid = minetest.find_nodes_in_area(ground_p1,ground_p2,{"group:solid"}) - local air = minetest.find_nodes_in_area(vector.offset(pos,-def.sidelen/2,1,-def.sidelen/2),vector.offset(pos,def.sidelen/2,4,def.sidelen/2),{"air"}) - if #solid < ( def.sidelen * def.sidelen ) or - #air < (def.sidelen * def.sidelen ) then + if #solid < ( def.sidelen * def.sidelen ) then if def.make_foundation then - minetest.bulk_set_node(minetest.find_nodes_in_area(ground_p1,vector.offset(ground_p2,0,-30,0),{"air"}),node) + minetest.bulk_set_node(minetest.find_nodes_in_area(ground_p1,ground_p2,{"air","group:liquid"}),{name=node_top}) + minetest.bulk_set_node(minetest.find_nodes_in_area(vector.offset(ground_p1,0,-1,0),vector.offset(ground_p2,0,-30,0),{"air","group:liquid"}),{name=node_fill}) else if logging then minetest.log("warning","[mcl_structures] "..def.name.." at "..minetest.pos_to_string(pos).." not placed. No solid ground.") @@ -34,13 +36,18 @@ function mcl_structures.place_structure(pos, def, pr) return false end if def.filenames then - local file = def.filenames[pr:next(1,#def.filenames)] - local pp = vector.offset(pos,0,y_offset,0) - mcl_structures.place_schematic(pp, file, "random", nil, true, "place_center_x,place_center_z",def.after_place,pr,{pos,def}) - if logging then - minetest.log("action","[mcl_structures] "..def.name.." placed at "..minetest.pos_to_string(pos)) + table.shuffle(def.filenames) + local file = def.filenames[1] + if file then + local ap = function(pos,def,pr) 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) return ap(pos,def,pr) end,pr) + if logging then + minetest.log("action","[mcl_structures] "..def.name.." placed at "..minetest.pos_to_string(pos)) + end + return true end - return true elseif def.place_func and def.place_func(pos,def,pr) then if not def.after_place or ( def.after_place and def.after_place(pos,def,pr) ) then if logging then @@ -65,23 +72,26 @@ function mcl_structures.register_structure(name,def,nospawn) --nospawn means it sbgroups.structblock = nil sbgroups.structblock_lbm = 1 else - def.deco = minetest.register_decoration({ - name = "mcl_structures:deco_"..name, - decoration = structblock, - deco_type = "simple", - place_on = def.place_on, - spawn_by = def.spawn_by, - num_spawn_by = def.num_spawn_by, - sidelen = 80, - fill_ratio = def.fill_ratio, - noise_params = def.noise_params, - flags = flags, - biomes = def.biomes, - y_max = def.y_max, - y_min = def.y_min - }) - def.deco_id = minetest.get_decoration_id("mcl_structures:deco_"..name) - minetest.set_gen_notify({decoration=true}, { def.deco_id }) + minetest.register_on_mods_loaded(function() --make sure all previous decorations and biomes have been registered + def.deco = minetest.register_decoration({ + name = "mcl_structures:deco_"..name, + decoration = structblock, + deco_type = "simple", + place_on = def.place_on, + spawn_by = def.spawn_by, + num_spawn_by = def.num_spawn_by, + sidelen = 80, + fill_ratio = def.fill_ratio, + noise_params = def.noise_params, + flags = flags, + biomes = def.biomes, + y_max = def.y_max, + y_min = def.y_min + }) + def.deco_id = minetest.get_decoration_id("mcl_structures:deco_"..name) + minetest.set_gen_notify({decoration=true}, { def.deco_id }) + --catching of gennotify happens in mcl_mapgen_core + end) end minetest.register_node(":"..structblock, {drawtype="airlike", walkable = false, pointable = false,groups = sbgroups}) def.structblock = structblock @@ -94,10 +104,10 @@ minetest.register_lbm({ run_at_every_load = true, nodenames = {"group:structblock_lbm"}, action = function(pos, node) + minetest.remove_node(pos) local name = node.name:gsub("mcl_structures:structblock_","") local def = mcl_structures.registered_structures[name] if not def then return end - minetest.remove_node(pos) mcl_structures.place_structure(pos) end }) diff --git a/mods/MAPGEN/mcl_structures/desert_temple.lua b/mods/MAPGEN/mcl_structures/desert_temple.lua new file mode 100644 index 000000000..9398e6062 --- /dev/null +++ b/mods/MAPGEN/mcl_structures/desert_temple.lua @@ -0,0 +1,107 @@ +local modname = minetest.get_current_modname() +local S = minetest.get_translator(modname) +local modpath = minetest.get_modpath(modname) + +local function temple_placement_callback(p1, p2, pr) + -- Delete cacti leftovers: + local cactus_nodes = minetest.find_nodes_in_area_under_air(p1, p2, "mcl_core:cactus") + if cactus_nodes and #cactus_nodes > 0 then + for _, pos in pairs(cactus_nodes) do + local node_below = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}) + if node_below and node_below.name == "mcl_core:sandstone" then + minetest.swap_node(pos, {name="air"}) + end + end + end + + -- Find chests. + -- FIXME: Searching this large area just for the chets is not efficient. Need a better way to find the chests; + -- probably let's just infer it from newpos because the schematic always the same. + local chests = minetest.find_nodes_in_area(p1, p2, "mcl_chests:chest") + + -- Add desert temple loot into chests + for c=1, #chests do + local lootitems = mcl_loot.get_multi_loot({ + { + stacks_min = 2, + stacks_max = 4, + items = { + { itemstring = "mcl_mobitems:bone", weight = 25, amount_min = 4, amount_max=6 }, + { itemstring = "mcl_mobitems:rotten_flesh", weight = 25, amount_min = 3, amount_max=7 }, + { itemstring = "mcl_mobitems:spider_eye", weight = 25, amount_min = 1, amount_max=3 }, + { itemstring = "mcl_books:book", weight = 20, func = function(stack, pr) + mcl_enchanting.enchant_uniform_randomly(stack, {"soul_speed"}, pr) + end }, + { itemstring = "mcl_mobitems:saddle", weight = 20, }, + { itemstring = "mcl_core:apple_gold", weight = 20, }, + { itemstring = "mcl_core:gold_ingot", weight = 15, amount_min = 2, amount_max = 7 }, + { itemstring = "mcl_core:iron_ingot", weight = 15, amount_min = 1, amount_max = 5 }, + { itemstring = "mcl_core:emerald", weight = 15, amount_min = 1, amount_max = 3 }, + { itemstring = "", weight = 15, }, + { itemstring = "mcl_mobitems:iron_horse_armor", weight = 15, }, + { itemstring = "mcl_mobitems:gold_horse_armor", weight = 10, }, + { itemstring = "mcl_mobitems:diamond_horse_armor", weight = 5, }, + { itemstring = "mcl_core:diamond", weight = 5, amount_min = 1, amount_max = 3 }, + { itemstring = "mcl_core:apple_gold_enchanted", weight = 2, }, + } + }, + { + stacks_min = 4, + stacks_max = 4, + items = { + { itemstring = "mcl_mobitems:bone", weight = 10, amount_min = 1, amount_max = 8 }, + { itemstring = "mcl_mobitems:rotten_flesh", weight = 10, amount_min = 1, amount_max = 8 }, + { itemstring = "mcl_mobitems:gunpowder", weight = 10, amount_min = 1, amount_max = 8 }, + { itemstring = "mcl_core:sand", weight = 10, amount_min = 1, amount_max = 8 }, + { itemstring = "mcl_mobitems:string", weight = 10, amount_min = 1, amount_max = 8 }, + } + }}, pr) + mcl_structures.init_node_construct(chests[c]) + local meta = minetest.get_meta(chests[c]) + local inv = meta:get_inventory() + mcl_loot.fill_inventory(inv, "main", lootitems, pr) + end + + -- Initialize pressure plates and randomly remove up to 5 plates + local pplates = minetest.find_nodes_in_area(p1, p2, "mesecons_pressureplates:pressure_plate_stone_off") + local pplates_remove = 5 + for p=1, #pplates do + if pplates_remove > 0 and pr:next(1, 100) >= 50 then + -- Remove plate + minetest.remove_node(pplates[p]) + pplates_remove = pplates_remove - 1 + else + -- Initialize plate + minetest.registered_nodes["mesecons_pressureplates:pressure_plate_stone_off"].on_construct(pplates[p]) + end + end +end + +mcl_structures.register_structure("desert_temple",{ + place_on = {"group:sand"}, + noise_params = { + offset = 0, + scale = 0.0000822, + spread = {x = 250, y = 250, z = 250}, + seed = 34115, + octaves = 3, + persist = -0.4, + flags = "absvalue", + }, + flags = "place_center_x, place_center_z", + solid_ground = true, + make_foundation = true, + sidelen = 18, + y_offset = -12, + chunk_probability = 256, + y_max = mcl_vars.mg_overworld_max, + y_min = 1, + biomes = { "Desert" }, + after_place = function(pos,def,pr) + local hl = def.sidelen / 2 + local p1 = vector.offset(pos,-hl,-hl,-hl) + local p2 = vector.offset(pos,hl,hl,hl) + temple_placement_callback(p1, p2, pr) + end, + filenames = { modpath.."/schematics/mcl_structures_desert_temple.mts" }, +}) diff --git a/mods/MAPGEN/mcl_structures/init.lua b/mods/MAPGEN/mcl_structures/init.lua index ffc25d40c..f15072165 100644 --- a/mods/MAPGEN/mcl_structures/init.lua +++ b/mods/MAPGEN/mcl_structures/init.lua @@ -67,6 +67,7 @@ local function init_node_construct(pos) end return false end +mcl_structures.init_node_construct = init_node_construct -- The call of Struct function mcl_structures.call_struct(pos, struct_style, rotation, pr) @@ -74,11 +75,7 @@ function mcl_structures.call_struct(pos, struct_style, rotation, pr) if not rotation then rotation = "random" end - if struct_style == "desert_temple" then - return mcl_structures.generate_desert_temple(pos, rotation, pr) - elseif struct_style == "desert_well" then - return mcl_structures.generate_desert_well(pos, rotation) - elseif struct_style == "igloo" then + if struct_style == "igloo" then return mcl_structures.generate_igloo(pos, rotation, pr) elseif struct_style == "witch_hut" then return mcl_structures.generate_witch_hut(pos, rotation) @@ -101,12 +98,6 @@ function mcl_structures.call_struct(pos, struct_style, rotation, pr) end end -function mcl_structures.generate_desert_well(pos, rot) - local newpos = {x=pos.x,y=pos.y-2,z=pos.z} - local path = modpath.."/schematics/mcl_structures_desert_well.mts" - return mcl_structures.place_schematic(newpos, path, rot or "0", nil, true) -end - function mcl_structures.generate_igloo(pos, rotation, pr) -- Place igloo local success, rotation = mcl_structures.generate_igloo_top(pos, pr) @@ -443,93 +434,6 @@ function mcl_structures.generate_end_portal_shrine(pos, rotation, pr) mcl_structures.place_schematic(newpos, path, rotation or "0", nil, true, nil, shrine_placement_callback, pr) end -local function temple_placement_callback(p1, p2, size, rotation, pr) - - -- Delete cacti leftovers: - local cactus_nodes = minetest.find_nodes_in_area_under_air(p1, p2, "mcl_core:cactus") - if cactus_nodes and #cactus_nodes > 0 then - for _, pos in pairs(cactus_nodes) do - local node_below = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}) - if node_below and node_below.name == "mcl_core:sandstone" then - minetest.swap_node(pos, {name="air"}) - end - end - end - - -- Find chests. - -- FIXME: Searching this large area just for the chets is not efficient. Need a better way to find the chests; - -- probably let's just infer it from newpos because the schematic always the same. - local chests = minetest.find_nodes_in_area(p1, p2, "mcl_chests:chest") - - -- Add desert temple loot into chests - for c=1, #chests do - local lootitems = mcl_loot.get_multi_loot({ - { - stacks_min = 2, - stacks_max = 4, - items = { - { itemstring = "mcl_mobitems:bone", weight = 25, amount_min = 4, amount_max=6 }, - { itemstring = "mcl_mobitems:rotten_flesh", weight = 25, amount_min = 3, amount_max=7 }, - { itemstring = "mcl_mobitems:spider_eye", weight = 25, amount_min = 1, amount_max=3 }, - { itemstring = "mcl_books:book", weight = 20, func = function(stack, pr) - mcl_enchanting.enchant_uniform_randomly(stack, {"soul_speed"}, pr) - end }, - { itemstring = "mcl_mobitems:saddle", weight = 20, }, - { itemstring = "mcl_core:apple_gold", weight = 20, }, - { itemstring = "mcl_core:gold_ingot", weight = 15, amount_min = 2, amount_max = 7 }, - { itemstring = "mcl_core:iron_ingot", weight = 15, amount_min = 1, amount_max = 5 }, - { itemstring = "mcl_core:emerald", weight = 15, amount_min = 1, amount_max = 3 }, - { itemstring = "", weight = 15, }, - { itemstring = "mcl_mobitems:iron_horse_armor", weight = 15, }, - { itemstring = "mcl_mobitems:gold_horse_armor", weight = 10, }, - { itemstring = "mcl_mobitems:diamond_horse_armor", weight = 5, }, - { itemstring = "mcl_core:diamond", weight = 5, amount_min = 1, amount_max = 3 }, - { itemstring = "mcl_core:apple_gold_enchanted", weight = 2, }, - } - }, - { - stacks_min = 4, - stacks_max = 4, - items = { - { itemstring = "mcl_mobitems:bone", weight = 10, amount_min = 1, amount_max = 8 }, - { itemstring = "mcl_mobitems:rotten_flesh", weight = 10, amount_min = 1, amount_max = 8 }, - { itemstring = "mcl_mobitems:gunpowder", weight = 10, amount_min = 1, amount_max = 8 }, - { itemstring = "mcl_core:sand", weight = 10, amount_min = 1, amount_max = 8 }, - { itemstring = "mcl_mobitems:string", weight = 10, amount_min = 1, amount_max = 8 }, - } - }}, pr) - init_node_construct(chests[c]) - local meta = minetest.get_meta(chests[c]) - local inv = meta:get_inventory() - mcl_loot.fill_inventory(inv, "main", lootitems, pr) - end - - -- Initialize pressure plates and randomly remove up to 5 plates - local pplates = minetest.find_nodes_in_area(p1, p2, "mesecons_pressureplates:pressure_plate_stone_off") - local pplates_remove = 5 - for p=1, #pplates do - if pplates_remove > 0 and pr:next(1, 100) >= 50 then - -- Remove plate - minetest.remove_node(pplates[p]) - pplates_remove = pplates_remove - 1 - else - -- Initialize plate - minetest.registered_nodes["mesecons_pressureplates:pressure_plate_stone_off"].on_construct(pplates[p]) - end - end -end - -function mcl_structures.generate_desert_temple(pos, rotation, pr) - -- No Generating for the temple ... Why using it ? No Change - local path = modpath.."/schematics/mcl_structures_desert_temple.mts" - local newpos = {x=pos.x,y=pos.y-12,z=pos.z} - --local size = {x=22, y=24, z=22} - if newpos == nil then - return - end - mcl_structures.place_schematic(newpos, path, rotation or "random", nil, true, nil, temple_placement_callback, pr) -end - local structure_data = {} --[[ Returns a table of structure of the specified type. @@ -572,6 +476,31 @@ local function dir_to_rotation(dir) end dofile(modpath.."/api.lua") +dofile(modpath.."/desert_temple.lua") +dofile(modpath.."/jungle_temple.lua") + +mcl_structures.register_structure("desert_well",{ + place_on = {"group:sand"}, + noise_params = { + offset = 0, + scale = 0.00012, + spread = {x = 250, y = 250, z = 250}, + seed = 233, + octaves = 3, + persist = 0.001, + flags = "absvalue", + }, + flags = "place_center_x, place_center_z", + not_near = { "desert_temple_new" }, + solid_ground = true, + sidelen = 4, + chunk_probability = 64, + y_max = mcl_vars.mg_overworld_max, + y_min = 1, + y_offset = -2, + biomes = { "Desert" }, + filenames = { modpath.."/schematics/mcl_structures_desert_well.mts" }, +}) -- Debug command minetest.register_chatcommand("spawnstruct", { @@ -589,11 +518,7 @@ minetest.register_chatcommand("spawnstruct", { local pr = PseudoRandom(pos.x+pos.y+pos.z) local errord = false local message = S("Structure placed.") - if param == "desert_temple" then - mcl_structures.generate_desert_temple(pos, rot, pr) - elseif param == "desert_well" then - mcl_structures.generate_desert_well(pos, rot) - elseif param == "igloo" then + if param == "igloo" then mcl_structures.generate_igloo(pos, rot, pr) elseif param == "witch_hut" then mcl_structures.generate_witch_hut(pos, rot, pr) diff --git a/mods/MAPGEN/mcl_structures/jungle_temple.lua b/mods/MAPGEN/mcl_structures/jungle_temple.lua new file mode 100644 index 000000000..1dc89b787 --- /dev/null +++ b/mods/MAPGEN/mcl_structures/jungle_temple.lua @@ -0,0 +1,70 @@ +local modname = minetest.get_current_modname() +local S = minetest.get_translator(modname) +local modpath = minetest.get_modpath(modname) + +local function temple_placement_callback(p1, p2, pr) + --dont remove foliage - looks kind of nice for a jt + local chests = minetest.find_nodes_in_area(p1, p2, "mcl_chests:trapped_chest_small") + -- Add jungle temple loot into chests + for c=1, #chests do + local lootitems = mcl_loot.get_multi_loot({ + { + stacks_min = 2, + stacks_max = 6, + items = { + { itemstring = "mcl_mobitems:bone", weight = 20, amount_min = 4, amount_max=6 }, + { itemstring = "mcl_mobitems:rotten_flesh", weight = 16, amount_min = 3, amount_max=7 }, + { itemstring = "mcl_core:gold_ingot", weight = 15, amount_min = 2, amount_max = 7 }, + --{ itemstring = "mcl_bamboo:bamboo", weight = 15, amount_min = 1, amount_max=3 }, --FIXME BAMBOO + { itemstring = "mcl_core:iron_ingot", weight = 15, amount_min = 1, amount_max = 5 }, + { itemstring = "mcl_core:diamond", weight = 3, amount_min = 1, amount_max = 3 }, + { itemstring = "mcl_mobitems:saddle", weight = 3, }, + { itemstring = "mcl_core:emerald", weight = 2, amount_min = 1, amount_max = 3 }, + { itemstring = "mcl_books:book", weight = 1, func = function(stack, pr) + mcl_enchanting.enchant_uniform_randomly(stack, {"soul_speed"}, pr) + end }, + { itemstring = "mcl_mobitems:iron_horse_armor", weight = 1, }, + { itemstring = "mcl_mobitems:gold_horse_armor", weight = 1, }, + { itemstring = "mcl_mobitems:diamond_horse_armor", weight = 1, }, + { itemstring = "mcl_core:apple_gold_enchanted", weight = 2, }, + } + }}, pr) + mcl_structures.init_node_construct(chests[c]) + local meta = minetest.get_meta(chests[c]) + local inv = meta:get_inventory() + mcl_loot.fill_inventory(inv, "main", lootitems, pr) + end + -- TODO: initialize traps +end + +mcl_structures.register_structure("jungle_temple",{ + place_on = {"group:grass_block","group:dirt","mcl_core:dirt_with_grass"}, + noise_params = { + offset = 0, + scale = 0.0000812, + spread = {x = 250, y = 250, z = 250}, + seed = 31585, + octaves = 3, + persist = -0.2, + flags = "absvalue", + }, + flags = "place_center_x, place_center_z", + solid_ground = true, + make_foundation = true, + y_offset = -5, + chunk_probability = 256, + y_max = mcl_vars.mg_overworld_max, + y_min = 1, + biomes = { "Jungle" }, + sidelen = 18, + filenames = { + modpath.."/schematics/mcl_structures_jungle_temple.mts", + modpath.."/schematics/mcl_structures_jungle_temple_nice.mts", + }, + after_place = function(pos,def,pr) + local hl = def.sidelen / 2 + local p1 = vector.offset(pos,-hl,-hl,-hl) + local p2 = vector.offset(pos,hl,hl,hl) + temple_placement_callback(p1, p2, pr) + end, +}) diff --git a/mods/MAPGEN/mcl_structures/mod.conf b/mods/MAPGEN/mcl_structures/mod.conf index c19113ad4..823714aad 100644 --- a/mods/MAPGEN/mcl_structures/mod.conf +++ b/mods/MAPGEN/mcl_structures/mod.conf @@ -1,4 +1,4 @@ name = mcl_structures author = Wuzzy, cora description = Structure placement for MCL2 -depends = mcl_loot +depends = mcl_init, mcl_loot diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_jungle_temple.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_jungle_temple.mts new file mode 100644 index 0000000000000000000000000000000000000000..ec98a83ea359fafabc55ec0df882634a601a9790 GIT binary patch literal 2586 zcmZ`&4K$Q#8=f)EJHxy&C^JTQ(O6Q9pH#EaJ4~8N)*vY||MD{!<0mN@48}Gz`mj{H zA%B&evHcC-R$~mNrLDeHBeZI@8=F09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 z#iw5r0uL*Pz)J-01&#E;5kh57+k*_y3mNECYp`=r|BP@yD+YKr;Et~~KG|mEv zpfZhQQ{16n0ag}G>gj-5G|+6WvZ6#D(@hfS&c$&X{HzyV?e_(a0`$^?*_FS{;!q<< z2ULb^?+rF}`C+TlBk5qokW@~bJ8gO(JLvW(>Iw-;{3Q64fu<|Qm%pkCz4-=moW^l0 zg2xfz;c!oe@>&u6^VWG#nT7QFOxr`rMA&=d6F(BZLMHe_6YCgpCDpC)AzY&o)4t{c zPje!uT67r=CDC_1DldW-jv{nNbS+*C>*lD=5%YpsVm(T$+22ZgyoZu52hXx8QpD3V zL<+fWB7m2kS)`7o)-dNEIv}f74p{Kmh?7{d;wvW0#LWNI9v=o-0b8^bi6(BDI&8V? zWRm~>{g0hb3aPd`H=0|!Vy|OOnD#yJJJB4=WX5%KrTUwEtlhD97-XHM!DjDD-F1oy z50{s<`r`$E&X1;o0_pY3g>l%^ zZ3}1TEEBRiNv`S_WVa|$lU;lvF6PkIC|`r!{1;i4YV^_UY@dBk774LmE4$s+TI1I| zntE}uXt0EWJNXoz@n8173zw+uGtGM=8limamkqwLT`hpMM1>KtUzFRfKzcgku`Xs^ z=%^}aQ-jS&jPU!;x{F`P#0MFTgn?L|+PqOl#9-{NW_GRUO0tRZ?NV}vfw+gDv3J;4n1B~R2;lkS&AL|QHN6@_NE*Ts5#-b@#xip%htZcsQniB~GzxjnhJI`4>))Ip{SH zJuF;hQ7`?_hF499&?HK1u!8TMMGS5qYYNG-b8E++>Pb0gW$fZz)m-)9g(Bfxm~CxG zd2vwpZFZ2`v=It;3m9x4FEIQ;Ggfy0iGWMmo4DR|y7Uq;pJ;BbAksRaJi!#Zz5yk? O=Ofi15Yfy7q<;etnMdjX literal 0 HcmV?d00001 diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_jungle_temple_nice.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_jungle_temple_nice.mts new file mode 100644 index 0000000000000000000000000000000000000000..8a9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