X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fworld%2FBlockLookup.hpp;h=605b896f2553785964c72f55e809c162f72fe8f3;hb=8639a90bcbcd045c57cd489f02a25e0df4236deb;hp=122b3c76f7e76374eaf50aa264513d54564b43c6;hpb=d2fa8ca97d291508ce3812fb052a8255d3190d00;p=blank.git diff --git a/src/world/BlockLookup.hpp b/src/world/BlockLookup.hpp index 122b3c7..605b896 100644 --- a/src/world/BlockLookup.hpp +++ b/src/world/BlockLookup.hpp @@ -22,6 +22,8 @@ public: // only valid if lookup was successful Chunk &GetChunk() const noexcept { return *chunk; } const Chunk::Pos &GetBlockPos() const noexcept { return pos; } + int GetBlockIndex() const noexcept { return Chunk::ToIndex(pos); } + Block::Pos GetBlockCoords() const noexcept { return Chunk::ToCoords(pos); } const Block &GetBlock() const noexcept { return GetChunk().BlockAt(GetBlockPos()); } const BlockType &GetType() const noexcept { return GetChunk().Type(GetBlock()); } int GetLight() const noexcept { return GetChunk().GetLight(GetBlockPos()); }