diff options
author | Mattes D <github@xoft.cz> | 2020-04-17 11:36:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-17 11:36:37 +0200 |
commit | 26ac146f41091dc070d8075f5fc9de25b5a22578 (patch) | |
tree | 5be089162a23ad2f2822be7b5d5d7cebbb958406 /src/Chunk.h | |
parent | Implement glowing redstone ore (diff) | |
download | cuberite-26ac146f41091dc070d8075f5fc9de25b5a22578.tar cuberite-26ac146f41091dc070d8075f5fc9de25b5a22578.tar.gz cuberite-26ac146f41091dc070d8075f5fc9de25b5a22578.tar.bz2 cuberite-26ac146f41091dc070d8075f5fc9de25b5a22578.tar.lz cuberite-26ac146f41091dc070d8075f5fc9de25b5a22578.tar.xz cuberite-26ac146f41091dc070d8075f5fc9de25b5a22578.tar.zst cuberite-26ac146f41091dc070d8075f5fc9de25b5a22578.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Chunk.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/Chunk.h b/src/Chunk.h index 7ba12f5ef..bb6f2e5b5 100644 --- a/src/Chunk.h +++ b/src/Chunk.h @@ -147,7 +147,7 @@ public: void Tick(std::chrono::milliseconds a_Dt); /** Ticks a single block. Used by cWorld::TickQueuedBlocks() to tick the queued blocks */ - void TickBlock(int a_RelX, int a_RelY, int a_RelZ); + void TickBlock(const Vector3i a_RelPos); int GetPosX(void) const { return m_PosX; } int GetPosZ(void) const { return m_PosZ; } @@ -375,12 +375,12 @@ public: m_IsSaving = false; } - /** Sets the blockticking to start at the specified block. Only one blocktick may be set, second call overwrites the first call */ - inline void SetNextBlockTick(int a_RelX, int a_RelY, int a_RelZ) + /** Causes the specified block to be ticked on the next Tick() call. + Plugins can use this via the cWorld:SetNextBlockToTick() API. + Only one block coord per chunk may be set, a second call overwrites the first call */ + inline void SetNextBlockToTick(const Vector3i a_RelPos) { - m_BlockTickX = a_RelX; - m_BlockTickY = a_RelY; - m_BlockTickZ = a_RelZ; + m_BlockToTick = a_RelPos; } inline NIBBLETYPE GetMeta(int a_RelX, int a_RelY, int a_RelZ) const @@ -629,7 +629,9 @@ private: cChunkDef::HeightMap m_HeightMap; cChunkDef::BiomeMap m_BiomeMap; - int m_BlockTickX, m_BlockTickY, m_BlockTickZ; + /** Relative coords of the block to tick first in the next Tick() call. + Plugins can use this to force a tick in a specific block, using cWorld:SetNextBlockToTick() API. */ + Vector3i m_BlockToTick; cChunk * m_NeighborXM; // Neighbor at [X - 1, Z] cChunk * m_NeighborXP; // Neighbor at [X + 1, Z] |