diff options
author | madmaxoft <github@xoft.cz> | 2013-11-30 15:58:27 +0100 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2013-11-30 15:58:27 +0100 |
commit | c70c2fa42fa9336958e7b66a8813d075963f3463 (patch) | |
tree | 52ef965eb191c81aca95fd56146d10478496d645 /src/Chunk.cpp | |
parent | Added IsBiomeNoDownfall() function. (diff) | |
download | cuberite-c70c2fa42fa9336958e7b66a8813d075963f3463.tar cuberite-c70c2fa42fa9336958e7b66a8813d075963f3463.tar.gz cuberite-c70c2fa42fa9336958e7b66a8813d075963f3463.tar.bz2 cuberite-c70c2fa42fa9336958e7b66a8813d075963f3463.tar.lz cuberite-c70c2fa42fa9336958e7b66a8813d075963f3463.tar.xz cuberite-c70c2fa42fa9336958e7b66a8813d075963f3463.tar.zst cuberite-c70c2fa42fa9336958e7b66a8813d075963f3463.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Chunk.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/Chunk.cpp b/src/Chunk.cpp index b3b24e339..45825a30f 100644 --- a/src/Chunk.cpp +++ b/src/Chunk.cpp @@ -631,6 +631,23 @@ void cChunk::Tick(float a_Dt) +void cChunk::TickBlock(int a_RelX, int a_RelY, int a_RelZ) +{ + unsigned Index = MakeIndex(a_RelX, a_RelY, a_RelZ); + if (Index == INDEX_OUT_OF_RANGE) + { + // An assert has already been made in MakeIndex() + return; + } + cBlockHandler * Handler = BlockHandler(m_BlockTypes[Index]); + ASSERT(Handler != NULL); // Happenned on server restart, FS #243 + Handler->OnUpdate(*this, a_RelX + m_PosX * Width, a_RelY, a_RelZ + m_PosZ * Width); +} + + + + + void cChunk::MoveEntityToNewChunk(cEntity * a_Entity) { cChunk * Neighbor = GetNeighborChunk(a_Entity->GetChunkX() * cChunkDef::Width, a_Entity->GetChunkZ() * cChunkDef::Width); @@ -777,7 +794,7 @@ void cChunk::TickBlocks(void) unsigned int Index = MakeIndexNoCheck(m_BlockTickX, m_BlockTickY, m_BlockTickZ); cBlockHandler * Handler = BlockHandler(m_BlockTypes[Index]); ASSERT(Handler != NULL); // Happenned on server restart, FS #243 - Handler->OnUpdate(m_World, m_BlockTickX + m_PosX * Width, m_BlockTickY, m_BlockTickZ + m_PosZ * Width); + Handler->OnUpdate(*this, m_BlockTickX + m_PosX * Width, m_BlockTickY, m_BlockTickZ + m_PosZ * Width); } // for i - tickblocks } |