diff options
author | Alexander Harkness <bearbin@gmail.com> | 2014-06-11 14:01:52 +0200 |
---|---|---|
committer | Alexander Harkness <bearbin@gmail.com> | 2014-06-11 14:01:52 +0200 |
commit | c5010ebcc13c29a567755d938dabfa5250de73fc (patch) | |
tree | cba4c8ae1dd2e54190a8bf3b238a577e2185109b /src | |
parent | Add new IsWeatherWet hook for cauldrons. (diff) | |
download | cuberite-c5010ebcc13c29a567755d938dabfa5250de73fc.tar cuberite-c5010ebcc13c29a567755d938dabfa5250de73fc.tar.gz cuberite-c5010ebcc13c29a567755d938dabfa5250de73fc.tar.bz2 cuberite-c5010ebcc13c29a567755d938dabfa5250de73fc.tar.lz cuberite-c5010ebcc13c29a567755d938dabfa5250de73fc.tar.xz cuberite-c5010ebcc13c29a567755d938dabfa5250de73fc.tar.zst cuberite-c5010ebcc13c29a567755d938dabfa5250de73fc.zip |
Diffstat (limited to '')
-rw-r--r-- | src/World.h | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/src/World.h b/src/World.h index b0fed84ba..ac275b991 100644 --- a/src/World.h +++ b/src/World.h @@ -707,22 +707,39 @@ public: /** Returns the current weather. Instead of comparing values directly to the weather constants, use IsWeatherXXX() functions, if possible */ eWeather GetWeather (void) const { return m_Weather; }; + /** Returns true if the current weather is sun */ bool IsWeatherSunny(void) const { return (m_Weather == wSunny); } - bool IsWeatherSunny(int a_BlockX, int a_BlockZ) const { + + /** Returns true if it is sunny at the specified location. This takes into accunt biomes. */ + bool IsWeatherSunnyAt(int a_BlockX, int a_BlockZ) const + { return (m_Weather == wSunny) } - bool IsWeatherRain (void) const { return (m_Weather == wRain); } - bool IsWeatherRain (int a_BlockX, int a_BlockZ) const { + + /** Returns true if the current weather is rain */ + bool IsWeatherRain(void) const { return (m_Weather == wRain); } + + /** Returns true if it is raining at the specified location. This takes into accunt biomes. */ + bool IsWeatherRainAt (int a_BlockX, int a_BlockZ) const + { return (m_Weather == wRain) && (!IsBiomeNoDownfall(GetBiomeAt(a_BlockX, a_BlockZ))) } + + /** Returns true if the current weather is stormy */ bool IsWeatherStorm(void) const { return (m_Weather == wStorm); } - bool IsWeatherStorm(int a_BlockX, int a_BlockZ) const { + + /** Returns true if the weather is stormy at the specified location. This takes into accunt biomes. */ + bool IsWeatherStormAt(int a_BlockX, int a_BlockZ) const + { return (m_Weather == wStorm) && (!IsBiomeNoDownfall(GetBiomeAt(a_BlockX, a_BlockZ))) } - /** Returns true if the current weather has any precipitation - rain or storm */ - bool IsWeatherWet (void) const { return (m_Weather != wSunny); } - bool IsWeatherWet (int a_BlockX, int a_BlockZ) const { + /** Returns true if the current weather has any precipitation - rain, storm or snow */ + bool IsWeatherWet(void) const { return (m_Weather != wSunny); } + + /** Returns true if it is raining, stormy or snowing at the specified location. This takes into accunt biomes. */ + bool IsWeatherWetAt(int a_BlockX, int a_BlockZ) const + { return (m_Weather != wSunny) && (!IsBiomeNoDownfall(GetBiomeAt(a_BlockX, a_BlockZ))) } // tolua_end |