summaryrefslogtreecommitdiffstats
path: root/src/Generating/Caves.cpp
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-12-17 17:33:30 +0100
committerHowaner <franzi.moos@googlemail.com>2014-12-17 17:33:30 +0100
commit6ee7fd3c6792235c873e24b16331e3a8278021cc (patch)
tree707fb63ebda192bad5603c5c280d99746b510cc4 /src/Generating/Caves.cpp
parentImplemented vanilla-like shift click. (diff)
parentMerge pull request #1674 from gushromp/master (diff)
downloadcuberite-6ee7fd3c6792235c873e24b16331e3a8278021cc.tar
cuberite-6ee7fd3c6792235c873e24b16331e3a8278021cc.tar.gz
cuberite-6ee7fd3c6792235c873e24b16331e3a8278021cc.tar.bz2
cuberite-6ee7fd3c6792235c873e24b16331e3a8278021cc.tar.lz
cuberite-6ee7fd3c6792235c873e24b16331e3a8278021cc.tar.xz
cuberite-6ee7fd3c6792235c873e24b16331e3a8278021cc.tar.zst
cuberite-6ee7fd3c6792235c873e24b16331e3a8278021cc.zip
Diffstat (limited to 'src/Generating/Caves.cpp')
-rw-r--r--src/Generating/Caves.cpp25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/Generating/Caves.cpp b/src/Generating/Caves.cpp
index e4735cb83..1e8dbef90 100644
--- a/src/Generating/Caves.cpp
+++ b/src/Generating/Caves.cpp
@@ -100,6 +100,7 @@ public:
void ProcessChunk(
int a_ChunkX, int a_ChunkZ,
cChunkDef::BlockTypes & a_BlockTypes,
+ cChunkDesc::BlockNibbleBytes & a_BlockMetas,
cChunkDef::HeightMap & a_HeightMap
);
@@ -455,6 +456,7 @@ void cCaveTunnel::CalcBoundingBox(void)
void cCaveTunnel::ProcessChunk(
int a_ChunkX, int a_ChunkZ,
cChunkDef::BlockTypes & a_BlockTypes,
+ cChunkDesc::BlockNibbleBytes & a_BlockMetas,
cChunkDef::HeightMap & a_HeightMap
)
{
@@ -505,6 +507,22 @@ void cCaveTunnel::ProcessChunk(
cChunkDef::SetBlock(a_BlockTypes, x, y, z, E_BLOCK_AIR);
}
}
+ else if (SqDist <= SqRad * 2)
+ {
+ if (cChunkDef::GetBlock(a_BlockTypes, x, y, z) == E_BLOCK_SAND)
+ {
+ int Index = cChunkDef::MakeIndexNoCheck(x, y, z);
+ if (a_BlockMetas[Index] == 1)
+ {
+ a_BlockMetas[Index] = 0;
+ cChunkDef::SetBlock(a_BlockTypes, x, y, z, E_BLOCK_RED_SANDSTONE);
+ }
+ else
+ {
+ cChunkDef::SetBlock(a_BlockTypes, x, y, z, E_BLOCK_SANDSTONE);
+ }
+ }
+ }
} // for y
} // for x, z
} // for itr - m_Points[]
@@ -596,11 +614,12 @@ void cStructGenWormNestCaves::cCaveSystem::DrawIntoChunk(cChunkDesc & a_ChunkDes
{
int ChunkX = a_ChunkDesc.GetChunkX();
int ChunkZ = a_ChunkDesc.GetChunkZ();
- cChunkDef::BlockTypes & BlockTypes = a_ChunkDesc.GetBlockTypes();
- cChunkDef::HeightMap & HeightMap = a_ChunkDesc.GetHeightMap();
+ cChunkDef::BlockTypes & BlockTypes = a_ChunkDesc.GetBlockTypes();
+ cChunkDef::HeightMap & HeightMap = a_ChunkDesc.GetHeightMap();
+ cChunkDesc::BlockNibbleBytes & BlockMetas = a_ChunkDesc.GetBlockMetasUncompressed();
for (cCaveTunnels::const_iterator itr = m_Tunnels.begin(), end = m_Tunnels.end(); itr != end; ++itr)
{
- (*itr)->ProcessChunk(ChunkX, ChunkZ, BlockTypes, HeightMap);
+ (*itr)->ProcessChunk(ChunkX, ChunkZ, BlockTypes, BlockMetas, HeightMap);
} // for itr - m_Tunnels[]
}