diff options
Diffstat (limited to 'src/World.cpp')
-rw-r--r-- | src/World.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/World.cpp b/src/World.cpp index 4dd9cbc86..4cf25aee3 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -542,6 +542,34 @@ void cWorld::ChangeWeather(void) +bool cWorld::IsWeatherWetAtXYZ(Vector3i a_Pos) +{ + if ((a_Pos.y < 0) || !IsWeatherWetAt(a_Pos.x, a_Pos.z)) + { + return false; + } + + 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; +} + + + + + void cWorld::SetNextBlockTick(int a_BlockX, int a_BlockY, int a_BlockZ) { return m_ChunkMap->SetNextBlockTick(a_BlockX, a_BlockY, a_BlockZ); |