diff options
author | Mattes D <github@xoft.cz> | 2014-05-07 22:18:23 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-05-07 22:18:23 +0200 |
commit | d9cdd4441e8a2877f2a5dcc724c781abfefafb77 (patch) | |
tree | 2609b4f09c2e224a32b21251539feeac381790fa /src/Blocks/BlockDirt.h | |
parent | Merge pull request #990 from Howaner/Entities (diff) | |
parent | Superfluous method override. (diff) | |
download | cuberite-d9cdd4441e8a2877f2a5dcc724c781abfefafb77.tar cuberite-d9cdd4441e8a2877f2a5dcc724c781abfefafb77.tar.gz cuberite-d9cdd4441e8a2877f2a5dcc724c781abfefafb77.tar.bz2 cuberite-d9cdd4441e8a2877f2a5dcc724c781abfefafb77.tar.lz cuberite-d9cdd4441e8a2877f2a5dcc724c781abfefafb77.tar.xz cuberite-d9cdd4441e8a2877f2a5dcc724c781abfefafb77.tar.zst cuberite-d9cdd4441e8a2877f2a5dcc724c781abfefafb77.zip |
Diffstat (limited to 'src/Blocks/BlockDirt.h')
-rw-r--r-- | src/Blocks/BlockDirt.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Blocks/BlockDirt.h b/src/Blocks/BlockDirt.h index aa24b8668..2d4fccbac 100644 --- a/src/Blocks/BlockDirt.h +++ b/src/Blocks/BlockDirt.h @@ -35,8 +35,10 @@ public: // Grass becomes dirt if there is something on top of it: if (a_RelY < cChunkDef::Height - 1) { - BLOCKTYPE Above = a_Chunk.GetBlock(a_RelX, a_RelY + 1, a_RelZ); - if ((!cBlockInfo::IsTransparent(Above) && !cBlockInfo::IsOneHitDig(Above)) || IsBlockWater(Above)) + BLOCKTYPE Above; + NIBBLETYPE AboveMeta; + a_Chunk.GetBlockTypeMeta(a_RelX, a_RelY + 1, a_RelZ, Above, AboveMeta); + if (!cBlockInfo::GetHandler(Above)->CanDirtGrowGrass(AboveMeta)) { a_Chunk.FastSetBlock(a_RelX, a_RelY, a_RelZ, E_BLOCK_DIRT, E_META_DIRT_NORMAL); return; @@ -77,7 +79,7 @@ public: BLOCKTYPE AboveDest; NIBBLETYPE AboveMeta; Chunk->GetBlockTypeMeta(BlockX, BlockY + 1, BlockZ, AboveDest, AboveMeta); - if ((cBlockInfo::IsOneHitDig(AboveDest) || cBlockInfo::IsTransparent(AboveDest)) && !IsBlockWater(AboveDest)) + if (cBlockInfo::GetHandler(AboveDest)->CanDirtGrowGrass(AboveMeta)) { if (!cRoot::Get()->GetPluginManager()->CallHookBlockSpread((cWorld*) &a_WorldInterface, BlockX * cChunkDef::Width, BlockY, BlockZ * cChunkDef::Width, ssGrassSpread)) { |