diff options
author | cedeel@gmail.com <cedeel@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-06-18 18:25:57 +0200 |
---|---|---|
committer | cedeel@gmail.com <cedeel@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-06-18 18:25:57 +0200 |
commit | beaf37a013e15fd84ea3daa15912e6d81e919149 (patch) | |
tree | 977cbc6e138e2848b02608eae561ac39cb4daf47 /source | |
parent | Removed the deprecated GetBlockEntity(), added several enumerators to replace it. (diff) | |
download | cuberite-beaf37a013e15fd84ea3daa15912e6d81e919149.tar cuberite-beaf37a013e15fd84ea3daa15912e6d81e919149.tar.gz cuberite-beaf37a013e15fd84ea3daa15912e6d81e919149.tar.bz2 cuberite-beaf37a013e15fd84ea3daa15912e6d81e919149.tar.lz cuberite-beaf37a013e15fd84ea3daa15912e6d81e919149.tar.xz cuberite-beaf37a013e15fd84ea3daa15912e6d81e919149.tar.zst cuberite-beaf37a013e15fd84ea3daa15912e6d81e919149.zip |
Diffstat (limited to 'source')
-rw-r--r-- | source/cChunk.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/source/cChunk.cpp b/source/cChunk.cpp index 9d7bc60ac..e185ef851 100644 --- a/source/cChunk.cpp +++ b/source/cChunk.cpp @@ -670,6 +670,7 @@ void cChunk::TickMelonPumpkin(int a_RelX, int a_RelY, int a_RelZ, int a_BlockIdx void cChunk::TickFarmland(int a_RelX, int a_RelY, int a_RelZ) { // TODO: Rain hydrates blocks, too. Check world weather, don't search for water if raining. + // NOTE: The desert biomes do not get precipitation, so another check needs to be made. // Search for water in a close proximity: // Ref.: http://www.minecraftwiki.net/wiki/Farmland#Hydrated_Farmland_Tiles @@ -727,10 +728,18 @@ void cChunk::TickFarmland(int a_RelX, int a_RelY, int a_RelZ) return; } - // Farmland too dry. Turn back to dirt: - FastSetBlock(a_RelX, a_RelY, a_RelZ, E_BLOCK_DIRT, 0); + // Farmland too dry. If nothing is growing on top, turn back to dirt: - // TODO: Uproot whatever was growing on top: + switch (GetBlock(a_RelX, a_RelY + 1, a_RelZ)) + { + case E_BLOCK_CROPS: + case E_BLOCK_MELON_STEM: + case E_BLOCK_PUMPKIN_STEM: + break; + default: + FastSetBlock(a_RelX, a_RelY, a_RelZ, E_BLOCK_DIRT, 0); + break; + } } |