From 06280e3bba47729ae52c915351d303ce6fbb7bee Mon Sep 17 00:00:00 2001 From: kay27 Date: Tue, 23 Mar 2021 03:17:23 +0400 Subject: [PATCH] [mcl_portals] Generate target map chunks on portal creation --- mods/ITEMS/mcl_portals/portal_nether.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mods/ITEMS/mcl_portals/portal_nether.lua b/mods/ITEMS/mcl_portals/portal_nether.lua index f67980bbf..862965bbb 100644 --- a/mods/ITEMS/mcl_portals/portal_nether.lua +++ b/mods/ITEMS/mcl_portals/portal_nether.lua @@ -592,6 +592,11 @@ function mcl_portals.light_nether_portal(pos) local orientation = random(0, 1) for orientation_iteration = 1, 2 do if check_and_light_shape(pos, orientation) then + minetest.after(0.2, function(pos) -- generate target map chunk + local pos1 = add(mul(mcl_vars.pos_to_chunk(pos), mcl_vars.chunk_size_in_nodes), mcl_vars.central_chunk_offset_in_nodes) + local pos2 = add(pos1, mcl_vars.chunk_size_in_nodes - 1) + minetest.emerge_area(pos1, pos2) + end, vector.new(pos)) return true end orientation = 1 - orientation