summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockDirt.h
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-04-03 21:43:40 +0200
committerHowaner <franzi.moos@googlemail.com>2014-04-03 21:43:40 +0200
commitca08a44c988ed7c295a43e9a0a9579b093e4abf4 (patch)
treeb172e9a9113227a3e1ab5402c7ab4b6d7f2ba75b /src/Blocks/BlockDirt.h
parentAdd cancelling to WeatherChanging event. (diff)
downloadcuberite-ca08a44c988ed7c295a43e9a0a9579b093e4abf4.tar
cuberite-ca08a44c988ed7c295a43e9a0a9579b093e4abf4.tar.gz
cuberite-ca08a44c988ed7c295a43e9a0a9579b093e4abf4.tar.bz2
cuberite-ca08a44c988ed7c295a43e9a0a9579b093e4abf4.tar.lz
cuberite-ca08a44c988ed7c295a43e9a0a9579b093e4abf4.tar.xz
cuberite-ca08a44c988ed7c295a43e9a0a9579b093e4abf4.tar.zst
cuberite-ca08a44c988ed7c295a43e9a0a9579b093e4abf4.zip
Diffstat (limited to '')
-rw-r--r--src/Blocks/BlockDirt.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/Blocks/BlockDirt.h b/src/Blocks/BlockDirt.h
index 91534c5e5..098494585 100644
--- a/src/Blocks/BlockDirt.h
+++ b/src/Blocks/BlockDirt.h
@@ -3,6 +3,7 @@
#include "BlockHandler.h"
#include "../MersenneTwister.h"
+#include "BlockSlab.h"
@@ -35,8 +36,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 ((!g_BlockTransparent[Above] && !g_BlockOneHitDig[Above]) || IsBlockWater(Above))
+ BLOCKTYPE Above;
+ NIBBLETYPE AboveMeta;
+ a_Chunk.GetBlockTypeMeta(a_RelX, a_RelY + 1, a_RelZ, Above, AboveMeta);
+ if ((!g_BlockTransparent[Above] && !g_BlockOneHitDig[Above] && !(cBlockSlabHandler::IsAnySlabType(Above) && (AboveMeta & 0x8))) || IsBlockWater(Above))
{
a_Chunk.FastSetBlock(a_RelX, a_RelY, a_RelZ, E_BLOCK_DIRT, E_META_DIRT_NORMAL);
return;
@@ -77,7 +80,7 @@ public:
BLOCKTYPE AboveDest;
NIBBLETYPE AboveMeta;
Chunk->GetBlockTypeMeta(BlockX, BlockY + 1, BlockZ, AboveDest, AboveMeta);
- if ((g_BlockOneHitDig[AboveDest] || g_BlockTransparent[AboveDest]) && !IsBlockWater(AboveDest))
+ if ((g_BlockOneHitDig[AboveDest] || g_BlockTransparent[AboveDest] || ((cBlockSlabHandler::IsAnySlabType(AboveDest)) && (AboveMeta & 0x8))) && !IsBlockWater(AboveDest))
{
Chunk->FastSetBlock(BlockX, BlockY, BlockZ, E_BLOCK_GRASS, 0);
}
@@ -85,6 +88,12 @@ public:
}
+ bool IsGrowAble(BLOCKTYPE a_Block, NIBBLETYPE a_Meta)
+ {
+
+ }
+
+
virtual const char * GetStepSound(void) override
{
return "step.gravel";