forked from MineClone5/MineClone5
Remove cobblestone ceiling from dungeons
This commit is contained in:
parent
30a29a20c8
commit
e748237469
|
@ -191,8 +191,8 @@ minetest.register_on_generated(function(minp, maxp)
|
||||||
table.sort(chestSlots)
|
table.sort(chestSlots)
|
||||||
local currentChest = 1
|
local currentChest = 1
|
||||||
|
|
||||||
-- Ceiling and floor
|
-- Wall and floor
|
||||||
local maxx, maxy, maxz = x+dim.x+1, y+dim.y+1, z+dim.z+1
|
local maxx, maxy, maxz = x+dim.x+1, y+dim.y, z+dim.z+1
|
||||||
local chestSlotCounter = 1
|
local chestSlotCounter = 1
|
||||||
for tx = x, maxx do
|
for tx = x, maxx do
|
||||||
for tz = z, maxz do
|
for tz = z, maxz do
|
||||||
|
@ -211,13 +211,17 @@ minetest.register_on_generated(function(minp, maxp)
|
||||||
data[p_pos] = c_mossycobble
|
data[p_pos] = c_mossycobble
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Wall or ceiling
|
-- Generate walls
|
||||||
elseif ty == maxy or (ty > y and (tx == x or tx == maxx) or (tz == z or tz == maxz)) then
|
--[[ 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
|
-- 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
|
data[p_pos] = c_cobble
|
||||||
end
|
end
|
||||||
-- No-op if it was an opening
|
-- If it was an opening, the lower 3 blocks are not touched at all
|
||||||
|
|
||||||
-- Room interiour
|
-- Room interiour
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue