summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--source/Blocks/BlockCrops.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/Blocks/BlockCrops.h b/source/Blocks/BlockCrops.h
index 9e19b14ec..e7b320eac 100644
--- a/source/Blocks/BlockCrops.h
+++ b/source/Blocks/BlockCrops.h
@@ -78,10 +78,16 @@ public:
void OnUpdate(cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ) override
{
NIBBLETYPE Meta = a_World->GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ);
- if (Meta < 7)
+ NIBBLETYPE Light = a_World->GetBlockBlockLight(a_BlockX, a_BlockY, a_BlockZ);
+
+ if ((Meta < 7) && (Light > 8))
{
a_World->FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_CROPS, ++Meta);
}
+ else if (Light < 9)
+ {
+ a_World->DigBlock(a_BlockX, a_BlockY, a_BlockZ);
+ }
}