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/World.cpp | |
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/World.cpp | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/src/World.cpp b/src/World.cpp index 46d08ab44..6b224b634 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -548,28 +548,27 @@ void cWorld::ChangeWeather(void) -bool cWorld::IsWeatherWetAtXYZ(Vector3i a_Pos) +bool cWorld::IsWeatherSunnyAt(int a_BlockX, int a_BlockZ) const { - if ((a_Pos.y < 0) || !IsWeatherWetAt(a_Pos.x, a_Pos.z)) - { - return false; - } + return m_ChunkMap.IsWeatherSunnyAt(a_BlockX, a_BlockZ); +} - if (a_Pos.y >= cChunkDef::Height) - { - return true; - } - for (int y = GetHeight(a_Pos.x, a_Pos.z); y >= a_Pos.y; y--) - { - auto BlockType = GetBlock({a_Pos.x, y, a_Pos.z}); - if (cBlockInfo::IsRainBlocker(BlockType)) - { - return false; - } - } - return true; + + +bool cWorld::IsWeatherWetAt(int a_BlockX, int a_BlockZ) +{ + return m_ChunkMap.IsWeatherWetAt(a_BlockX, a_BlockZ); +} + + + + + +bool cWorld::IsWeatherWetAtXYZ(const Vector3i a_Position) +{ + return m_ChunkMap.IsWeatherWetAt(a_Position); } |