From adc4e9f810bde86f55dc64d13d8480f914435afc Mon Sep 17 00:00:00 2001 From: cora Date: Mon, 12 Sep 2022 15:43:21 +0200 Subject: [PATCH] Move end gateway portal to structure api --- mods/MAPGEN/mcl_structures/end_spawn.lua | 6 +++++- mods/MAPGEN/mcl_structures/init.lua | 17 +++-------------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/mods/MAPGEN/mcl_structures/end_spawn.lua b/mods/MAPGEN/mcl_structures/end_spawn.lua index b6838ce0f..9f7237e72 100644 --- a/mods/MAPGEN/mcl_structures/end_spawn.lua +++ b/mods/MAPGEN/mcl_structures/end_spawn.lua @@ -34,11 +34,15 @@ mcl_structures.register_structure("end_exit_portal",{ end }) mcl_structures.register_structure("end_exit_portal_open",{ - --static_pos = { mcl_vars.mg_end_exit_portal_pos }, filenames = { modpath.."/schematics/mcl_structures_end_exit_portal.mts" }, }) +mcl_structures.register_structure("end_gateway_portal",{ + filenames = { + modpath.."/schematics/mcl_structures_end_gateway_portal.mts" + }, +}) local function get_tower(p,h,tbl) for i = 1,h do diff --git a/mods/MAPGEN/mcl_structures/init.lua b/mods/MAPGEN/mcl_structures/init.lua index afa16904f..f57fa34f4 100644 --- a/mods/MAPGEN/mcl_structures/init.lua +++ b/mods/MAPGEN/mcl_structures/init.lua @@ -81,18 +81,11 @@ function mcl_structures.call_struct(pos, struct_style, rotation, pr) if not rotation then rotation = "random" end - if struct_style == "end_gateway_portal" then - return mcl_structures.generate_end_gateway_portal(pos, rotation) - elseif struct_style == "end_portal_shrine" then + if struct_style == "end_portal_shrine" then return mcl_structures.generate_end_portal_shrine(pos, rotation, pr) end end -function mcl_structures.generate_end_gateway_portal(pos, rot) - local path = modpath.."/schematics/mcl_structures_end_gateway_portal.mts" - return mcl_structures.place_schematic(pos, path, rot or "0", nil, true) -end - local function shrine_placement_callback(p1, p2, size, rotation, pr) -- Find and setup spawner with silverfish local spawners = minetest.find_nodes_in_area(p1, p2, "mcl_mobspawners:spawner") @@ -297,7 +290,7 @@ mcl_structures.register_structure("ice_spike_large",{ -- Debug command minetest.register_chatcommand("spawnstruct", { - params = "end_gateway_portal | end_portal_shrine | nether_portal | dungeon", + params = "end_portal_shrine | dungeon", description = S("Generate a pre-defined structure near your position."), privs = {debug = true}, func = function(name, param) @@ -311,14 +304,10 @@ minetest.register_chatcommand("spawnstruct", { local pr = PseudoRandom(pos.x+pos.y+pos.z) local errord = false local message = S("Structure placed.") - if param == "end_gateway_portal" then - mcl_structures.generate_end_gateway_portal(pos, rot, pr) - elseif param == "end_portal_shrine" then + if param == "end_portal_shrine" then mcl_structures.generate_end_portal_shrine(pos, rot, pr) elseif param == "dungeon" and mcl_dungeons and mcl_dungeons.spawn_dungeon then mcl_dungeons.spawn_dungeon(pos, rot, pr) - elseif param == "nether_portal" and mcl_portals and mcl_portals.spawn_nether_portal then - mcl_portals.spawn_nether_portal(pos, rot, pr, name) elseif param == "" then message = S("Error: No structure type given. Please use “/spawnstruct ”.") errord = true