From e7482374694bc5ca1aac74221715423849bf251a Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 24 May 2017 22:29:36 +0200 Subject: [PATCH] Remove cobblestone ceiling from dungeons --- mods/MAPGEN/mcl_dungeons/init.lua | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/mods/MAPGEN/mcl_dungeons/init.lua b/mods/MAPGEN/mcl_dungeons/init.lua index 6296b1309..6c44f197f 100644 --- a/mods/MAPGEN/mcl_dungeons/init.lua +++ b/mods/MAPGEN/mcl_dungeons/init.lua @@ -191,8 +191,8 @@ minetest.register_on_generated(function(minp, maxp) table.sort(chestSlots) local currentChest = 1 - -- Ceiling and floor - local maxx, maxy, maxz = x+dim.x+1, y+dim.y+1, z+dim.z+1 + -- Wall and floor + local maxx, maxy, maxz = x+dim.x+1, y+dim.y, z+dim.z+1 local chestSlotCounter = 1 for tx = x, maxx do for tz = z, maxz do @@ -211,13 +211,17 @@ minetest.register_on_generated(function(minp, maxp) data[p_pos] = c_mossycobble end - -- Wall or ceiling - elseif ty == maxy or (ty > y and (tx == x or tx == maxx) or (tz == z or tz == maxz)) then + -- Generate walls + --[[ Note: No cobblestone additional ceiling is generated. This is intentional. + The solid blocks above the dungeon are considered as the “ceiling”. + It is possible (but rare) for a dungeon to generate below sand or gravel. ]] + + elseif ty > y and (tx == x or tx == maxx or (tz == z or tz == maxz)) then -- Check if it's an opening first - if not (ty < maxy-1 and openings[tx][tz] == true) then + if (not openings[tx][tz]) or ty == maxy then data[p_pos] = c_cobble end - -- No-op if it was an opening + -- If it was an opening, the lower 3 blocks are not touched at all -- Room interiour else