Merge pull request #226 from SamJBarney/master
Crop blocks now respect light.
This commit is contained in:
commit
790f25a9ac
@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user