From beaf37a013e15fd84ea3daa15912e6d81e919149 Mon Sep 17 00:00:00 2001 From: "cedeel@gmail.com" Date: Mon, 18 Jun 2012 16:25:57 +0000 Subject: Crops aren't uprooted if farmland is dry. Vanilla behavior confirmed. git-svn-id: http://mc-server.googlecode.com/svn/trunk@630 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cChunk.cpp | 15 ++++++++++++--- 1 file 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; + } } -- cgit v1.2.3