summaryrefslogtreecommitdiffstats
path: root/src/World.cpp
diff options
context:
space:
mode:
authorAlexander Harkness <me@bearbin.net>2017-12-26 22:25:57 +0100
committerGitHub <noreply@github.com>2017-12-26 22:25:57 +0100
commit6309c6a97fdbabfde978358f5f9a0f61ab74f91f (patch)
tree18b76401b21bb16425d6a630e109d737afea6bb7 /src/World.cpp
parent.editorconfig fixes (#4113) (diff)
downloadcuberite-6309c6a97fdbabfde978358f5f9a0f61ab74f91f.tar
cuberite-6309c6a97fdbabfde978358f5f9a0f61ab74f91f.tar.gz
cuberite-6309c6a97fdbabfde978358f5f9a0f61ab74f91f.tar.bz2
cuberite-6309c6a97fdbabfde978358f5f9a0f61ab74f91f.tar.lz
cuberite-6309c6a97fdbabfde978358f5f9a0f61ab74f91f.tar.xz
cuberite-6309c6a97fdbabfde978358f5f9a0f61ab74f91f.tar.zst
cuberite-6309c6a97fdbabfde978358f5f9a0f61ab74f91f.zip
Diffstat (limited to '')
-rw-r--r--src/World.cpp28
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);