summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authoradmin@omencraft.com <admin@omencraft.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-11-15 01:39:01 +0100
committeradmin@omencraft.com <admin@omencraft.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-11-15 01:39:01 +0100
commit3ea286fef8f602e7d49987aaf2ca2d43899a5c62 (patch)
tree90de7f785f6df5bdcb7a48e2fa17f7f9fc9812a0 /source
parentPut view distance back to 13. Didn't mean to change that. (diff)
downloadcuberite-3ea286fef8f602e7d49987aaf2ca2d43899a5c62.tar
cuberite-3ea286fef8f602e7d49987aaf2ca2d43899a5c62.tar.gz
cuberite-3ea286fef8f602e7d49987aaf2ca2d43899a5c62.tar.bz2
cuberite-3ea286fef8f602e7d49987aaf2ca2d43899a5c62.tar.lz
cuberite-3ea286fef8f602e7d49987aaf2ca2d43899a5c62.tar.xz
cuberite-3ea286fef8f602e7d49987aaf2ca2d43899a5c62.tar.zst
cuberite-3ea286fef8f602e7d49987aaf2ca2d43899a5c62.zip
Diffstat (limited to 'source')
-rw-r--r--source/cChunk.cpp49
1 files changed, 37 insertions, 12 deletions
diff --git a/source/cChunk.cpp b/source/cChunk.cpp
index c3fbafef9..b2cd443f8 100644
--- a/source/cChunk.cpp
+++ b/source/cChunk.cpp
@@ -750,17 +750,18 @@ void cChunk::GenerateTerrain()
{
- const ENUM_BLOCK_ID GrassID = E_BLOCK_GRASS;
- const ENUM_BLOCK_ID DirtID = E_BLOCK_DIRT;
- const ENUM_BLOCK_ID StoneID = E_BLOCK_STONE;
- const ENUM_BLOCK_ID SandID = E_BLOCK_SAND;
- const ENUM_BLOCK_ID CaveID = E_BLOCK_AIR;
- const ENUM_BLOCK_ID LavaID = E_BLOCK_STATIONARY_LAVA;
- const ENUM_BLOCK_ID CoalID = E_BLOCK_COAL_ORE;
- const ENUM_BLOCK_ID IronID = E_BLOCK_IRON_ORE;
- const ENUM_BLOCK_ID GoldID = E_BLOCK_GOLD_ORE;
- const ENUM_BLOCK_ID DiamondID = E_BLOCK_DIAMOND_ORE;
- const ENUM_BLOCK_ID RedID = E_BLOCK_REDSTONE_ORE;
+ const ENUM_BLOCK_ID GrassID = E_BLOCK_GRASS;
+ const ENUM_BLOCK_ID DirtID = E_BLOCK_DIRT;
+ const ENUM_BLOCK_ID StoneID = E_BLOCK_STONE;
+ const ENUM_BLOCK_ID SandID = E_BLOCK_SAND;
+ const ENUM_BLOCK_ID SandStoneID = E_BLOCK_SANDSTONE;
+ const ENUM_BLOCK_ID CaveID = E_BLOCK_AIR;
+ const ENUM_BLOCK_ID LavaID = E_BLOCK_STATIONARY_LAVA;
+ const ENUM_BLOCK_ID CoalID = E_BLOCK_COAL_ORE;
+ const ENUM_BLOCK_ID IronID = E_BLOCK_IRON_ORE;
+ const ENUM_BLOCK_ID GoldID = E_BLOCK_GOLD_ORE;
+ const ENUM_BLOCK_ID DiamondID = E_BLOCK_DIAMOND_ORE;
+ const ENUM_BLOCK_ID RedID = E_BLOCK_REDSTONE_ORE;
/*
const ENUM_BLOCK_ID GrassID = E_BLOCK_AIR;
@@ -813,6 +814,8 @@ void cChunk::GenerateTerrain()
}
else if( y < 61 && Top - y < 3 )
m_BlockType[ MakeIndex(x, y, z) ] = SandID;
+ else if( y < 61 && Top - y < 4 )
+ m_BlockType[ MakeIndex(x, y, z) ] = SandStoneID;
else if( Top - y > ((WaveNoise+1.5f)*1.5f) ) // rock and ores between 1.5 .. 4.5 deep
{
if( GetOreNoise( xx, yy, zz, m_Noise ) > 0.5f )
@@ -853,8 +856,30 @@ void cChunk::GenerateTerrain()
}
if( TopY > 0 )
{
- // Change top dirt into grass
+ // Change top dirt into grass and prevent sand from floating over caves
int index = MakeIndex( x, TopY, z );
+ int index1 = MakeIndex( x, TopY-1, z );
+ int index2 = MakeIndex( x, TopY-2, z );
+ int index3 = MakeIndex( x, TopY-3, z );
+ int index4 = MakeIndex( x, TopY-4, z );
+ int index5 = MakeIndex( x, TopY-5, z );
+
+ if( m_BlockType[index] == SandID ) {
+
+ if( m_BlockType[index1] == CaveID ) {
+ m_BlockType[ index ] = (char)SandStoneID;
+ } else if( m_BlockType[index2] == CaveID ) {
+ m_BlockType[ index1 ] = (char)SandStoneID;
+ } else if( m_BlockType[index3] == CaveID ) {
+ m_BlockType[ index2 ] = (char)SandStoneID;
+ } else if( m_BlockType[index4] == CaveID ) {
+ m_BlockType[ index3 ] = (char)SandStoneID;
+ } else if( m_BlockType[index5] == CaveID ) {
+ m_BlockType[ index4 ] = (char)SandStoneID;
+ }
+
+ }
+
if( m_BlockType[index] == DirtID )
{
m_BlockType[ index ] = (char)GrassID;