X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fworld%2FBlockLookup.hpp;h=605b896f2553785964c72f55e809c162f72fe8f3;hb=b066e776622f96e906600a0c4a08de392bd03676;hp=e861b249efd628b8c4dc83b74ef792e2fab97cd3;hpb=e1209ec25c4cc91e13889876106f56bd51aa96e2;p=blank.git diff --git a/src/world/BlockLookup.hpp b/src/world/BlockLookup.hpp index e861b24..605b896 100644 --- a/src/world/BlockLookup.hpp +++ b/src/world/BlockLookup.hpp @@ -22,6 +22,7 @@ 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()); }