From 8fa8a6fe3723cc2c3aade1eebb069006bbc014bc Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Wed, 8 Dec 2021 11:27:19 +0100 Subject: [PATCH] Add command to spawn large ruined portal --- mods/MAPGEN/mcl_structures/init.lua | 30 +++++++++++++++--- .../mcl_structures_ruined_portal_large_1.mts | Bin 0 -> 2729 bytes 2 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 mods/MAPGEN/mcl_structures/schematics/mcl_structures_ruined_portal_large_1.mts diff --git a/mods/MAPGEN/mcl_structures/init.lua b/mods/MAPGEN/mcl_structures/init.lua index 5aa26a57..45f6803f 100644 --- a/mods/MAPGEN/mcl_structures/init.lua +++ b/mods/MAPGEN/mcl_structures/init.lua @@ -89,6 +89,8 @@ mcl_structures.call_struct = function(pos, struct_style, rotation, pr) return mcl_structures.generate_end_exit_portal(pos, rotation) elseif struct_style == "end_portal_shrine" then return mcl_structures.generate_end_portal_shrine(pos, rotation, pr) + elseif struct_style == "ruined_portal_large" then + return mcl_structures.generate_ruined_portal_large(pos, rotation, pr) elseif struct_style == "ruined_portal_small" then return mcl_structures.generate_ruined_portal_small(pos, rotation, pr) end @@ -406,7 +408,7 @@ mcl_structures.generate_end_portal_shrine = function(pos, rotation, pr) mcl_structures.place_schematic(newpos, path, "0", nil, true, nil, shrine_placement_callback, pr) end -local function ruined_portal_small_callback(p1, p2, size, rotation, pr) +local function ruined_portal_callback(p1, p2, size, rotation, pr) local biome_data = minetest.get_biome_data(p1) local biome_is_cold = (biome_data.heat < 15) or false local biome_name = minetest.get_biome_name(biome_data.biome) @@ -656,7 +658,10 @@ local function ruined_portal_small_callback(p1, p2, size, rotation, pr) minetest.set_node(nodes[n], node) end -- Add loot into chests. - local chests = minetest.find_nodes_in_area(p1, p2, "mcl_chests:chest_small") + local chests = minetest.find_nodes_in_area(p1, p2, { + "mcl_chests:chest_small", + "mcl_chests:trapped_chest_small" + }) for c=1, #chests do local lootitems = mcl_loot.get_multi_loot({ { @@ -690,6 +695,21 @@ local function ruined_portal_small_callback(p1, p2, size, rotation, pr) end end +mcl_structures.generate_ruined_portal_large = function(pos, orientation, pr) + -- Generates one out of 1 possible small ruined nether portals + local newpos = { + x = pos.x, + y = pos.y - 10, + z = pos.z + } + local portals = { + "mcl_structures_ruined_portal_large_1.mts", + } + local r = pr:next(1, #portals) + local path = minetest.get_modpath("mcl_structures") .. "/schematics/" .. portals[r] + return mcl_structures.place_schematic(newpos, path, orientation, nil, true, nil, ruined_portal_callback, pr) +end + mcl_structures.generate_ruined_portal_small = function(pos, orientation, pr) -- Generates one out of 5 possible small ruined nether portals local newpos = { @@ -706,7 +726,7 @@ mcl_structures.generate_ruined_portal_small = function(pos, orientation, pr) } local r = pr:next(1, #portals) local path = minetest.get_modpath("mcl_structures") .. "/schematics/" .. portals[r] - return mcl_structures.place_schematic(newpos, path, orientation, nil, true, nil, ruined_portal_small_callback, pr) + return mcl_structures.place_schematic(newpos, path, orientation, nil, true, nil, ruined_portal_callback, pr) end local function temple_placement_callback(p1, p2, size, rotation, pr) @@ -839,7 +859,7 @@ end -- Debug command minetest.register_chatcommand("spawnstruct", { - params = "desert_temple | desert_well | igloo | witch_hut | boulder | ice_spike_small | ice_spike_large | fossil | end_exit_portal | end_portal_shrine | ruined_portal_small", + params = "desert_temple | desert_well | igloo | witch_hut | boulder | ice_spike_small | ice_spike_large | fossil | end_exit_portal | end_portal_shrine | ruined_portal_large | ruined_portal_small", description = S("Generate a pre-defined structure near your position."), privs = {debug = true}, func = function(name, param) @@ -873,6 +893,8 @@ minetest.register_chatcommand("spawnstruct", { mcl_structures.generate_end_exit_portal(pos, rot, pr) elseif param == "end_portal_shrine" then mcl_structures.generate_end_portal_shrine(pos, rot, pr) + elseif param == "ruined_portal_large" then + mcl_structures.generate_ruined_portal_large(pos, rot, pr) elseif param == "ruined_portal_small" then mcl_structures.generate_ruined_portal_small(pos, rot, pr) elseif param == "" then diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ruined_portal_large_1.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_ruined_portal_large_1.mts new file mode 100644 index 0000000000000000000000000000000000000000..3a463a96ddc12d55db142776c37a55963908ea67 GIT binary patch literal 2729 zcmZ`&c|6ql8=viP)DI(3%orwZ5;D#-IWi=YqgavEm}bT~3^T^W`0?Awv98g&@1Hwz zt|KOtW6C(2M3{9=nnGG*qb1qFuC%Xw|M|S0_xpL?&-?j2pRc)%wK-rPKpY?ikO`eK(9O;Yq21so1WE2j!;p!hhNVQ#X7(n{pdM(Ml*rkUy;Hy3VYl#><=_U>fknzM4v1q&( zk+%i{+7`pBd2NoS-opJ@(-Ur-BF@bsAQkiJjmSbpP! zBw)2N^I^jD?~jK+HD1ag%|?Bg@+QF|)kP7oYMS3A+cbyTQ{!tTHp*TtQtRa%r=euA z6=DDM6!KtApa^#KdfCI?5IYxlYnHJB@rHHJYwiD+mW&D-a%Ahxw1cZIQ6i15X^l@` zYETEa!|T`noGIq^rgXDemZ7XYD9fXVnMM2!nFb}7`zFDp!dnsd%53s3%RE+(?=NmQ zj;6k&cI37n`P5h=&iG6WGgO_fjFr^MQ`1_nb$@iLKwF?GOzGkwH@^hDI*q#0I_k|A zSt3LCTK7 z7DGPkJ*74?%L~sHU@{u190L<^#)nE_H?}0$y1<#TLKD5G)*=0hGy+k>#i)urdzBJC zSD``d&Gby6y#DkZ$<b$dRu1hcVJMlCZsIUpo3 zU8kKC?|wm|D?2=+$v$IA$EZ%PIum+$vDxJmM!!%;zzy>r$Lsk#v1cjvrID(Dt`1zuTj}Lf^8Qm!yZD` z;Qd)2M5o&R5N)B`PO+#BF*+*CpN5AjnQO_g0LyNJ6Ra~WdX3A07xlzt@!(8R)p|h+ z!X&&_twLd1YyNWn9+G>Ll%o-{6j(I->s18gV5hp{uw|R+n(0*>zSTaw531@kon@EqoBw1JW9quU^wj1@QI#DjcXAV76Q;vV6|Yf zACUpK8nz37+AHXF3m0GM7auSjz;kd~4_rkq#LK1#LBM1iK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