1
0

Merge pull request #226 from SamJBarney/master

Crop blocks now respect light.
This commit is contained in:
Mattes D 2013-10-13 07:10:49 -07:00
commit 790f25a9ac

View File

@ -78,10 +78,16 @@ public:
void OnUpdate(cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ) override 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); 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); 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);
}
} }