diff options
author | Alexander Harkness <me@bearbin.net> | 2020-03-30 19:23:25 +0200 |
---|---|---|
committer | Alexander Harkness <me@bearbin.net> | 2020-03-30 19:23:25 +0200 |
commit | 52d5760be17235a1811e9a26ce849c4a33afad72 (patch) | |
tree | c31178adcb16b7668bd28d83a4e2974072c02379 /src/Chunk.h | |
parent | Update GETTING-STARTED.md (#4581) (diff) | |
download | cuberite-52d5760be17235a1811e9a26ce849c4a33afad72.tar cuberite-52d5760be17235a1811e9a26ce849c4a33afad72.tar.gz cuberite-52d5760be17235a1811e9a26ce849c4a33afad72.tar.bz2 cuberite-52d5760be17235a1811e9a26ce849c4a33afad72.tar.lz cuberite-52d5760be17235a1811e9a26ce849c4a33afad72.tar.xz cuberite-52d5760be17235a1811e9a26ce849c4a33afad72.tar.zst cuberite-52d5760be17235a1811e9a26ce849c4a33afad72.zip |
Diffstat (limited to 'src/Chunk.h')
-rw-r--r-- | src/Chunk.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Chunk.h b/src/Chunk.h index dd21d0e8f..35c4acf8d 100644 --- a/src/Chunk.h +++ b/src/Chunk.h @@ -415,6 +415,12 @@ public: /** Light alterations based on time */ NIBBLETYPE GetTimeAlteredLight(NIBBLETYPE a_Skylight) const; + /** Get the maximum of natural and artificial light illuminating the block (0 - 15). */ + inline NIBBLETYPE GetLight(Vector3i a_RelPos) const { return std::max(GetBlockLight(a_RelPos), GetSkyLight(a_RelPos)); } + + /** Get the maximum of natural and artificial light illuminating the block (0 - 15), taking daytime into account. */ + inline NIBBLETYPE GetLightAltered(Vector3i a_RelPos) const { return std::max(GetBlockLight(a_RelPos), GetSkyLightAltered(a_RelPos)); } + /** Get the level of artificial light illuminating the block (0 - 15) */ inline NIBBLETYPE GetBlockLight(Vector3i a_RelPos) const { return m_ChunkData.GetBlockLight(a_RelPos); } inline NIBBLETYPE GetBlockLight(int a_RelX, int a_RelY, int a_RelZ) const { return m_ChunkData.GetBlockLight({ a_RelX, a_RelY, a_RelZ }); } |