diff options
author | Mattes D <github@xoft.cz> | 2019-09-01 09:30:00 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2019-09-06 16:12:33 +0200 |
commit | a2ffa432b31096f2533ecb50f49ba450b29a2989 (patch) | |
tree | 5bdd754cad5e7b49e279ee0e21b9fa15c7c35d7b /src/ChunkDef.h | |
parent | Updated LibEvent to release 2.1.11-stable. (#4383) (diff) | |
download | cuberite-a2ffa432b31096f2533ecb50f49ba450b29a2989.tar cuberite-a2ffa432b31096f2533ecb50f49ba450b29a2989.tar.gz cuberite-a2ffa432b31096f2533ecb50f49ba450b29a2989.tar.bz2 cuberite-a2ffa432b31096f2533ecb50f49ba450b29a2989.tar.lz cuberite-a2ffa432b31096f2533ecb50f49ba450b29a2989.tar.xz cuberite-a2ffa432b31096f2533ecb50f49ba450b29a2989.tar.zst cuberite-a2ffa432b31096f2533ecb50f49ba450b29a2989.zip |
Diffstat (limited to 'src/ChunkDef.h')
-rw-r--r-- | src/ChunkDef.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/ChunkDef.h b/src/ChunkDef.h index bfed62aae..95abdaf58 100644 --- a/src/ChunkDef.h +++ b/src/ChunkDef.h @@ -65,6 +65,12 @@ public: { return ((m_ChunkX == a_Other.m_ChunkX) && (m_ChunkZ == a_Other.m_ChunkZ)); } + + /** Returns a string that describes the chunk coords, suitable for logging. */ + AString ToString() const + { + return Printf("[%d, %d]", m_ChunkX, m_ChunkZ); + } } ; @@ -445,7 +451,15 @@ struct sSetBlock BLOCKTYPE m_BlockType; NIBBLETYPE m_BlockMeta; - sSetBlock(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta); + sSetBlock(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta): + m_RelX(a_BlockX), + m_RelY(a_BlockY), + m_RelZ(a_BlockZ), + m_BlockType(a_BlockType), + m_BlockMeta(a_BlockMeta) + { + cChunkDef::AbsoluteToRelative(m_RelX, m_RelY, m_RelZ, m_ChunkX, m_ChunkZ); + } sSetBlock(int a_ChunkX, int a_ChunkZ, int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) : m_RelX(a_RelX), m_RelY(a_RelY), m_RelZ(a_RelZ), @@ -525,7 +539,7 @@ public: virtual ~cChunkCoordCallback() {} /** Called with the chunk's coords, and an optional operation status flag for operations that support it. */ - virtual void Call(int a_ChunkX, int a_ChunkZ, bool a_IsSuccess) = 0; + virtual void Call(cChunkCoords a_Coords, bool a_IsSuccess) = 0; } ; |