diff options
author | Tiger Wang <ziwei.tiger@outlook.com> | 2021-01-05 03:13:02 +0100 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@outlook.com> | 2021-01-11 17:39:56 +0100 |
commit | 9328afe65c72b29f5cedbf1897ea8559f6b2c42f (patch) | |
tree | 92d9490d062009278ed8d78f8981014e88ba8f05 /src/Blocks/BlockFarmland.h | |
parent | zlib -> libdeflate (#5085) (diff) | |
download | cuberite-9328afe65c72b29f5cedbf1897ea8559f6b2c42f.tar cuberite-9328afe65c72b29f5cedbf1897ea8559f6b2c42f.tar.gz cuberite-9328afe65c72b29f5cedbf1897ea8559f6b2c42f.tar.bz2 cuberite-9328afe65c72b29f5cedbf1897ea8559f6b2c42f.tar.lz cuberite-9328afe65c72b29f5cedbf1897ea8559f6b2c42f.tar.xz cuberite-9328afe65c72b29f5cedbf1897ea8559f6b2c42f.tar.zst cuberite-9328afe65c72b29f5cedbf1897ea8559f6b2c42f.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Blocks/BlockFarmland.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Blocks/BlockFarmland.h b/src/Blocks/BlockFarmland.h index f7003a650..2622ac98c 100644 --- a/src/Blocks/BlockFarmland.h +++ b/src/Blocks/BlockFarmland.h @@ -115,13 +115,14 @@ private: /** Returns true if there's either a water source block close enough to hydrate the specified position, or it's raining there. */ static bool IsWaterInNear(const cChunk & a_Chunk, const Vector3i a_RelPos) { - const auto WorldPos = a_Chunk.RelativeToAbsolute(a_RelPos); - if (a_Chunk.GetWorld()->IsWeatherWetAtXYZ(WorldPos)) + if (a_Chunk.IsWeatherWetAt(a_RelPos.addedY(1))) { // Rain hydrates farmland, too return true; } + const auto WorldPos = a_Chunk.RelativeToAbsolute(a_RelPos); + // Search for water in a close proximity: // Ref.: https://minecraft.gamepedia.com/Farmland#Hydration // TODO: Rewrite this to use the chunk and its neighbors directly |