diff options
Diffstat (limited to '')
-rw-r--r-- | src/Blocks/BlockDirt.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/Blocks/BlockDirt.h b/src/Blocks/BlockDirt.h index 336fa8c51..a06d9d030 100644 --- a/src/Blocks/BlockDirt.h +++ b/src/Blocks/BlockDirt.h @@ -51,8 +51,8 @@ public: { BLOCKTYPE above = a_Chunk.GetBlock(a_RelX, a_RelY + 1, a_RelZ); - // Grass turns back to dirt when the block above is not transparent - if (!cBlockInfo::IsTransparent(above)) + // Grass turns back to dirt when the block above it is not transparent or water + if (!cBlockInfo::IsTransparent(above) || IsBlockWater(above)) { a_Chunk.FastSetBlock(a_RelX, a_RelY, a_RelZ, E_BLOCK_DIRT, E_META_DIRT_NORMAL); return; @@ -97,10 +97,13 @@ public: // Not a regular dirt block continue; } - BLOCKTYPE above = a_Chunk.GetBlock(BlockX, BlockY + 1, BlockZ); - NIBBLETYPE light = std::max(a_Chunk.GetBlockLight(BlockX, BlockY + 1, BlockZ), a_Chunk.GetTimeAlteredLight(a_Chunk.GetSkyLight(BlockX, BlockY + 1, BlockZ))); - // Grass does not spread to blocks with a light level less than 5 - if ((light > 4) && cBlockInfo::IsTransparent(above)) + BLOCKTYPE above = Chunk->GetBlock(BlockX, BlockY + 1, BlockZ); + NIBBLETYPE light = std::max(Chunk->GetBlockLight(BlockX, BlockY + 1, BlockZ), Chunk->GetTimeAlteredLight(Chunk->GetSkyLight(BlockX, BlockY + 1, BlockZ))); + if ((light > 4) && + cBlockInfo::IsTransparent(above) && + (!IsBlockLava(above)) && + (!IsBlockWaterOrIce(above)) + ) { if (!cRoot::Get()->GetPluginManager()->CallHookBlockSpread(*Chunk->GetWorld(), Chunk->GetPosX() * cChunkDef::Width + BlockX, BlockY, Chunk->GetPosZ() * cChunkDef::Width + BlockZ, ssGrassSpread)) { |