diff --git a/mods/ITEMS/mcl_portals/portal_gateway.lua b/mods/ITEMS/mcl_portals/portal_gateway.lua index 9fa35a36f..fd455ee76 100644 --- a/mods/ITEMS/mcl_portals/portal_gateway.lua +++ b/mods/ITEMS/mcl_portals/portal_gateway.lua @@ -26,11 +26,9 @@ local gateway_positions = { local function spawn_gateway_portal(pos, dest_str) local path = minetest.get_modpath("mcl_structures").."/schematics/mcl_structures_end_gateway_portal.mts" - return mcl_structures.place_schematic(vector.add(pos, vector.new(-1, -2, -1)), path, "0", nil, true, nil, dest_str and function(p1, p2, size, orientation, pr, param) - -- minetest.get_voxel_manip():read_from_map(pos, pos) - minetest.get_meta(vector.add(p1, {x=1,y=2,z=1})):set_string("mcl_portals:gateway_destination", param.dest_str) - print(param.dest_str) - end, nil, {dest_str=dest_str}) + return mcl_structures.place_schematic(vector.add(pos, vector.new(-1, -2, -1)), path, "0", nil, true, nil, dest_str and function() + minetest.get_meta(pos):set_string("mcl_portals:gateway_destination", dest_str) + end) end function mcl_portals.spawn_gateway_portal() @@ -88,20 +86,14 @@ local function teleport(pos, obj) local minp = vector.subtract(dest_portal, vector.new(5, 40, 5)) local maxp = vector.add(dest_portal, vector.new(5, 10, 5)) preparing[pos_str] = true - minetest.emerge_area( - minp, - maxp, - function(blockpos, action, calls_remaining, param) - if calls_remaining < 1 then - local minp, maxp, dest_portal, obj, pos_str = param.minp, param.maxp, param.dest_portal, param.obj, param.pos_str - if obj and obj:is_player() or obj:get_luaentity() then - obj:set_pos(find_destination_pos(minp, maxp) or vector.add(dest_portal, vector.new(0, 3.5, 0))) - end - preparing[pos_str] = false + minetest.emerge_area(minp, maxp, function(blockpos, action, calls_remaining, param) + if calls_remaining < 1 then + if obj and obj:is_player() or obj:get_luaentity() then + obj:set_pos(find_destination_pos(minp, maxp) or vector.add(dest_portal, vector.new(0, 3.5, 0))) end - end, - {minp=vector.new(minp), maxp=vector.new(maxp), dest_portal=vector.new(dest_portal), obj=obj, pos_str=pos_str} - ) + preparing[pos_str] = false + end + end) end minetest.register_abm({ diff --git a/mods/MAPGEN/mcl_structures/init.lua b/mods/MAPGEN/mcl_structures/init.lua index 2ce5d94b5..b7afd18bb 100644 --- a/mods/MAPGEN/mcl_structures/init.lua +++ b/mods/MAPGEN/mcl_structures/init.lua @@ -318,11 +318,11 @@ end mcl_structures.generate_end_exit_portal = function(pos, rot) local path = minetest.get_modpath("mcl_structures").."/schematics/mcl_structures_end_exit_portal.mts" - return mcl_structures.place_schematic(pos, path, rot or "0", nil, true) + return mcl_structures.place_schematic(pos, path, rot or "0", {["mcl_portals:portal_end"] = "air"}, true) end mcl_structures.generate_end_exit_portal_open = function(pos, rot) - local path = minetest.get_modpath("mcl_structures").."/schematics/mcl_structures_end_exit_portal_open.mts" + local path = minetest.get_modpath("mcl_structures").."/schematics/mcl_structures_end_exit_portal.mts" return mcl_structures.place_schematic(pos, path, rot or "0", nil, true) end @@ -548,7 +548,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_exit_portal_opens | end_portal_shrine | nether_portal | gateway_portal | dungeon", + params = "desert_temple | desert_well | igloo | witch_hut | boulder | ice_spike_small | ice_spike_large | fossil | end_exit_portal | end_exit_portal_open | end_gateway_portal | end_portal_shrine | nether_portal | dungeon", description = S("Generate a pre-defined structure near your position."), privs = {debug = true}, func = function(name, param) @@ -590,8 +590,6 @@ minetest.register_chatcommand("spawnstruct", { 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 == "gateway_portal" and mcl_portals.spawn_gateway_portal then - mcl_portals.spawn_gateway_portal(pos, rot, pr, name) elseif param == "" then message = S("Error: No structure type given. Please use “/spawnstruct ”.") errord = true diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_end_exit_portal.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_end_exit_portal.mts index 30d145bd7..bc24f800a 100644 Binary files a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_end_exit_portal.mts and b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_end_exit_portal.mts differ diff --git a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_end_exit_portal_open.mts b/mods/MAPGEN/mcl_structures/schematics/mcl_structures_end_exit_portal_open.mts deleted file mode 100644 index bc24f800a..000000000 Binary files a/mods/MAPGEN/mcl_structures/schematics/mcl_structures_end_exit_portal_open.mts and /dev/null differ