From fd56bb746cd2cf0d146eee813ff41451bcfce2d0 Mon Sep 17 00:00:00 2001 From: kay27 Date: Sun, 2 May 2021 04:25:23 +0400 Subject: [PATCH] [mapgen] Spawn strongholds without emerge areas --- mods/MAPGEN/mcl_dungeons/init.lua | 5 ----- mods/MAPGEN/mcl_structures/init.lua | 4 +++- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/mods/MAPGEN/mcl_dungeons/init.lua b/mods/MAPGEN/mcl_dungeons/init.lua index a24e4dc9d..03a5c4e07 100644 --- a/mods/MAPGEN/mcl_dungeons/init.lua +++ b/mods/MAPGEN/mcl_dungeons/init.lua @@ -14,7 +14,6 @@ local swap_node = minetest.swap_node local set_node = minetest.set_node local dir_to_facedir = minetest.dir_to_facedir local get_meta = minetest.get_meta --- local emerge_area = minetest.emerge_area --vector local vector_add = vector.add @@ -403,8 +402,6 @@ local function dungeons_nodes(minp, maxp, blockseed) local z = pr:next(minp.z, maxp.z-dim.z-1) local p1 = {x=x,y=y,z=z} local p2 = {x = x+dim.x+1, y = y+dim.y+1, z = z+dim.z+1} - -- minetest.log("verbose","[mcl_dungeons] size=" ..minetest.pos_to_string(dim) .. ", emerge from "..minetest.pos_to_string(p1) .. " to " .. minetest.pos_to_string(p2)) - -- emerge_area(p1, p2, ecb_spawn_dungeon, {p1=p1, p2=p2, dim=dim, pr=pr}) spawn_dungeon(p1, p2, dim, pr) end end @@ -413,8 +410,6 @@ function mcl_dungeons.spawn_dungeon(p1, _, pr) if not p1 or not pr or not p1.x or not p1.y or not p1.z then return end local dim = dungeonsizes[pr:next(1, #dungeonsizes)] local p2 = {x = p1.x+dim.x+1, y = p1.y+dim.y+1, z = p1.z+dim.z+1} --- minetest.log("verbose","[mcl_dungeons] size=" ..minetest.pos_to_string(dim) .. ", emerge from "..minetest.pos_to_string(p1) .. " to " .. minetest.pos_to_string(p2)) --- emerge_area(p1, p2, ecb_spawn_dungeon, {p1=p1, p2=p2, dim=dim, pr=pr, dontcheck=true}) spawn_dungeon(p1, p2, dim, pr, true) end diff --git a/mods/MAPGEN/mcl_structures/init.lua b/mods/MAPGEN/mcl_structures/init.lua index 8304061af..617c19d46 100644 --- a/mods/MAPGEN/mcl_structures/init.lua +++ b/mods/MAPGEN/mcl_structures/init.lua @@ -33,7 +33,9 @@ mcl_structures.place_schematic = function(pos, schematic, rotation, replacements local p2 = {x=pos.x+x-1, y=pos.y+s.size.y-1, z=pos.z+z-1} minetest.log("verbose","[mcl_structures] size=" ..minetest.pos_to_string(s.size) .. ", rotation=" .. tostring(rotation) .. ", emerge from "..minetest.pos_to_string(p1) .. " to " .. minetest.pos_to_string(p2)) local param = {pos=vector.new(pos), schematic=s, rotation=rotation, replacements=replacements, force_placement=force_placement, flags=flags, p1=p1, p2=p2, after_placement_callback = after_placement_callback, size=vector.new(s.size), pr=pr, callback_param=callback_param} - minetest.emerge_area(p1, p2, ecb_place, param) + -- minetest.emerge_area(p1, p2, ecb_place, param) + -- TODO: Make it better + ecb_place(0, 0, 0, param) end end