summaryrefslogtreecommitdiffstats
path: root/src/Generating/DungeonRoomsFinisher.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-08-27 07:12:26 +0200
committerMattes D <github@xoft.cz>2014-08-27 07:12:26 +0200
commitc6beb9760bcfb86ac03317dbb252e0478107d009 (patch)
treed2dc1bc2ba73956bb957db915efe7bab723bbfa3 /src/Generating/DungeonRoomsFinisher.cpp
parentDungeonRooms: Chests are never placed next to each other. (diff)
downloadcuberite-c6beb9760bcfb86ac03317dbb252e0478107d009.tar
cuberite-c6beb9760bcfb86ac03317dbb252e0478107d009.tar.gz
cuberite-c6beb9760bcfb86ac03317dbb252e0478107d009.tar.bz2
cuberite-c6beb9760bcfb86ac03317dbb252e0478107d009.tar.lz
cuberite-c6beb9760bcfb86ac03317dbb252e0478107d009.tar.xz
cuberite-c6beb9760bcfb86ac03317dbb252e0478107d009.tar.zst
cuberite-c6beb9760bcfb86ac03317dbb252e0478107d009.zip
Diffstat (limited to 'src/Generating/DungeonRoomsFinisher.cpp')
-rw-r--r--src/Generating/DungeonRoomsFinisher.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/Generating/DungeonRoomsFinisher.cpp b/src/Generating/DungeonRoomsFinisher.cpp
index f4fb9b222..9555ee86c 100644
--- a/src/Generating/DungeonRoomsFinisher.cpp
+++ b/src/Generating/DungeonRoomsFinisher.cpp
@@ -197,13 +197,28 @@ protected:
int t = m_FloorHeight + 1 + ROOM_HEIGHT; // Top
ReplaceCuboidRandom(a_ChunkDesc, m_StartX, m_FloorHeight, m_StartZ, m_EndX + 1, b, m_EndZ + 1, E_BLOCK_MOSSY_COBBLESTONE, E_BLOCK_COBBLESTONE); // Floor
ReplaceCuboid(a_ChunkDesc, m_StartX + 1, b, m_StartZ + 1, m_EndX, t, m_EndZ, E_BLOCK_AIR); // Insides
+
// Walls:
ReplaceCuboid(a_ChunkDesc, m_StartX, b, m_StartZ, m_StartX + 1, t, m_EndZ, E_BLOCK_COBBLESTONE); // XM wall
ReplaceCuboid(a_ChunkDesc, m_EndX, b, m_StartZ, m_EndX + 1, t, m_EndZ, E_BLOCK_COBBLESTONE); // XP wall
ReplaceCuboid(a_ChunkDesc, m_StartX, b, m_StartZ, m_EndX + 1, t, m_StartZ + 1, E_BLOCK_COBBLESTONE); // ZM wall
ReplaceCuboid(a_ChunkDesc, m_StartX, b, m_EndZ, m_EndX + 1, t, m_EndZ + 1, E_BLOCK_COBBLESTONE); // ZP wall
+
+ // Place chests:
TryPlaceChest(a_ChunkDesc, m_Chest1);
TryPlaceChest(a_ChunkDesc, m_Chest2);
+
+ // Place the spawner:
+ int CenterX = (m_StartX + m_EndX) / 2 - a_ChunkDesc.GetChunkX() * cChunkDef::Width;
+ int CenterZ = (m_StartZ + m_EndZ) / 2 - a_ChunkDesc.GetChunkZ() * cChunkDef::Width;
+ if (
+ (CenterX >= 0) && (CenterX < cChunkDef::Width) &&
+ (CenterZ >= 0) && (CenterZ < cChunkDef::Width)
+ )
+ {
+ a_ChunkDesc.SetBlockTypeMeta(CenterX, b, CenterZ, E_BLOCK_MOB_SPAWNER, 0);
+ // TODO: Set the spawned mob
+ }
}
} ;