diff options
author | Mattes D <github@xoft.cz> | 2013-10-13 16:10:49 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2013-10-13 16:10:49 +0200 |
commit | 790f25a9ac643b945190a6e47a9c2f5a308b6ea7 (patch) | |
tree | c01f1f388fb0bac4427a9a2e560f306f46fdc6a8 | |
parent | Re-added the cWorld:GetSignLines() to the API. (diff) | |
parent | Removed faulty code dealing with water. (diff) | |
download | cuberite-790f25a9ac643b945190a6e47a9c2f5a308b6ea7.tar cuberite-790f25a9ac643b945190a6e47a9c2f5a308b6ea7.tar.gz cuberite-790f25a9ac643b945190a6e47a9c2f5a308b6ea7.tar.bz2 cuberite-790f25a9ac643b945190a6e47a9c2f5a308b6ea7.tar.lz cuberite-790f25a9ac643b945190a6e47a9c2f5a308b6ea7.tar.xz cuberite-790f25a9ac643b945190a6e47a9c2f5a308b6ea7.tar.zst cuberite-790f25a9ac643b945190a6e47a9c2f5a308b6ea7.zip |
Diffstat (limited to '')
-rw-r--r-- | source/Blocks/BlockCrops.h | 8 |
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); + } } |