summaryrefslogtreecommitdiffstats
path: root/source/cChunk.cpp
diff options
context:
space:
mode:
authoradmin@omencraft.com <admin@omencraft.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-11-05 20:31:25 +0100
committeradmin@omencraft.com <admin@omencraft.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-11-05 20:31:25 +0100
commit7fe70356b9e2186e807f11cbaa9d0baf09e0e129 (patch)
tree99df69b85767a8f62be29a4d6ec587864291d48b /source/cChunk.cpp
parentAdded cPiston.h and cPiston.cpp to VC2010 files. (diff)
downloadcuberite-7fe70356b9e2186e807f11cbaa9d0baf09e0e129.tar
cuberite-7fe70356b9e2186e807f11cbaa9d0baf09e0e129.tar.gz
cuberite-7fe70356b9e2186e807f11cbaa9d0baf09e0e129.tar.bz2
cuberite-7fe70356b9e2186e807f11cbaa9d0baf09e0e129.tar.lz
cuberite-7fe70356b9e2186e807f11cbaa9d0baf09e0e129.tar.xz
cuberite-7fe70356b9e2186e807f11cbaa9d0baf09e0e129.tar.zst
cuberite-7fe70356b9e2186e807f11cbaa9d0baf09e0e129.zip
Diffstat (limited to '')
-rw-r--r--source/cChunk.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/source/cChunk.cpp b/source/cChunk.cpp
index 420ba078f..e9fd739eb 100644
--- a/source/cChunk.cpp
+++ b/source/cChunk.cpp
@@ -323,22 +323,27 @@ void cChunk::Tick(float a_Dt)
case E_BLOCK_DIRT:
{
char AboveBlock = GetBlock( Index+1 );
- if( AboveBlock == 0 && GetLight( m_BlockSkyLight, Index ) > 0xf/2 ) // Half lit
+ if ( (AboveBlock == 0) && GetLight( m_BlockSkyLight, Index ) > 0xf/2 ) // Half lit //changed to not allow grass if any one hit object is on top
{
FastSetBlock( m_BlockTickX, m_BlockTickY, m_BlockTickZ, E_BLOCK_GRASS, GetLight( m_BlockMeta, Index ) );
}
+ if ( (g_BlockOneHitDig[AboveBlock]) && GetLight( m_BlockSkyLight, Index+1 ) > 0xf/2 ) // Half lit //ch$
+ {
+ FastSetBlock( m_BlockTickX, m_BlockTickY, m_BlockTickZ, E_BLOCK_GRASS, GetLight( m_BlockMeta, Index ) );
+ }
+
}
break;
case E_BLOCK_GRASS:
{
char AboveBlock = GetBlock( Index+1 );
- if( AboveBlock != 0 )
+ if (!( (AboveBlock == 0) || (g_BlockOneHitDig[AboveBlock]) ) ) //changed to not allow grass if any one hit object is on top
{
FastSetBlock( m_BlockTickX, m_BlockTickY, m_BlockTickZ, E_BLOCK_DIRT, GetLight( m_BlockMeta, Index ) );
}
}
break;
- case E_BLOCK_SAPLING:
+ case E_BLOCK_SAPLING: //todo: check meta of sapling. change m_World->GrowTree to look change trunk and leaves based on meta of sapling
{
FastSetBlock( m_BlockTickX, m_BlockTickY, m_BlockTickZ, E_BLOCK_AIR, GetLight( m_BlockMeta, Index ) );
m_World->GrowTree( m_BlockTickX + m_PosX*16, m_BlockTickY, m_BlockTickZ + m_PosZ*16 );
@@ -722,7 +727,7 @@ float GetOreNoise( float x, float y, float z, cNoise & a_Noise )
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;
@@ -733,8 +738,8 @@ void cChunk::GenerateTerrain()
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 RedID = E_BLOCK_REDSTONE_ORE;
+
/*
const ENUM_BLOCK_ID GrassID = E_BLOCK_AIR;
const ENUM_BLOCK_ID DirtID = E_BLOCK_AIR;