diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2015-06-27 00:24:51 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2015-12-18 14:17:38 +0100 |
commit | 5b62c4c3145c08b093521e42c565922fa85de4ad (patch) | |
tree | dca8cbfe86aa27af174da21f6835a8fbbe83d248 /src/Chunk.cpp | |
parent | Merge pull request #2770 from cuberite/RemoveChunkDataCollector (diff) | |
download | cuberite-5b62c4c3145c08b093521e42c565922fa85de4ad.tar cuberite-5b62c4c3145c08b093521e42c565922fa85de4ad.tar.gz cuberite-5b62c4c3145c08b093521e42c565922fa85de4ad.tar.bz2 cuberite-5b62c4c3145c08b093521e42c565922fa85de4ad.tar.lz cuberite-5b62c4c3145c08b093521e42c565922fa85de4ad.tar.xz cuberite-5b62c4c3145c08b093521e42c565922fa85de4ad.tar.zst cuberite-5b62c4c3145c08b093521e42c565922fa85de4ad.zip |
Diffstat (limited to 'src/Chunk.cpp')
-rw-r--r-- | src/Chunk.cpp | 96 |
1 files changed, 0 insertions, 96 deletions
diff --git a/src/Chunk.cpp b/src/Chunk.cpp index b991e073f..99311c1b1 100644 --- a/src/Chunk.cpp +++ b/src/Chunk.cpp @@ -605,9 +605,6 @@ void cChunk::Tick(std::chrono::milliseconds a_Dt) { BroadcastPendingBlockChanges(); - // Set all blocks that have been queued for setting later: - ProcessQueuedSetBlocks(); - CheckBlocks(); // Tick simulators: @@ -726,50 +723,6 @@ void cChunk::MoveEntityToNewChunk(cEntity * a_Entity) -void cChunk::ProcessQueuedSetBlocks(void) -{ - Int64 CurrTick = m_World->GetWorldAge(); - for (sSetBlockQueueVector::iterator itr = m_SetBlockQueue.begin(); itr != m_SetBlockQueue.end();) - { - if (itr->m_Tick <= CurrTick) - { - if (itr->m_PreviousType != E_BLOCK_AIR) // PreviousType defaults to 0 if not specified - { - if (GetBlock(itr->m_RelX, itr->m_RelY, itr->m_RelZ) == itr->m_PreviousType) - { - // Current world age is bigger than / equal to target world age - delay time reached AND - // Previous block type was the same as current block type (to prevent duplication) - SetBlock(itr->m_RelX, itr->m_RelY, itr->m_RelZ, itr->m_BlockType, itr->m_BlockMeta); // SetMeta doesn't send to client - itr = m_SetBlockQueue.erase(itr); - LOGD("Successfully set queued block - previous and current types matched"); - } - else - { - itr = m_SetBlockQueue.erase(itr); - LOGD("Failure setting queued block - previous and current blocktypes didn't match"); - } - } - else - { - // Current world age is bigger than / equal to target world age - delay time reached - SetBlock(itr->m_RelX, itr->m_RelY, itr->m_RelZ, itr->m_BlockType, itr->m_BlockMeta); - itr = m_SetBlockQueue.erase(itr); - LOGD("Successfully set queued block - previous type ignored"); - } - } - else - { - // Not yet - ++itr; - continue; - } - } // for itr - m_SetBlockQueue[] -} - - - - - void cChunk::BroadcastPendingBlockChanges(void) { if (m_PendingSendBlocks.empty()) @@ -1505,15 +1458,6 @@ void cChunk::SetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, -void cChunk::QueueSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Int64 a_Tick, BLOCKTYPE a_PreviousBlockType) -{ - m_SetBlockQueue.push_back(sSetBlockQueueItem(a_RelX, a_RelY, a_RelZ, a_BlockType, a_BlockMeta, a_Tick, a_PreviousBlockType)); -} - - - - - void cChunk::QueueTickBlock(int a_RelX, int a_RelY, int a_RelZ) { ASSERT ( @@ -2221,46 +2165,6 @@ bool cChunk::DoWithBlockEntityAt(int a_BlockX, int a_BlockY, int a_BlockZ, cBloc - -bool cChunk::DoWithRedstonePoweredEntityAt(int a_BlockX, int a_BlockY, int a_BlockZ, cRedstonePoweredCallback & a_Callback) -{ - // The blockentity list is locked by the parent chunkmap's CS - for (cBlockEntityList::iterator itr = m_BlockEntities.begin(), itr2 = itr; itr != m_BlockEntities.end(); itr = itr2) - { - ++itr2; - if (((*itr)->GetPosX() != a_BlockX) || ((*itr)->GetPosY() != a_BlockY) || ((*itr)->GetPosZ() != a_BlockZ)) - { - continue; - } - switch ((*itr)->GetBlockType()) - { - case E_BLOCK_DROPPER: - case E_BLOCK_DISPENSER: - case E_BLOCK_NOTE_BLOCK: - { - break; - } - default: - { - // There is a block entity here, but of different type. No other block entity can be here, so we can safely bail out - return false; - } - } - - if (a_Callback.Item(dynamic_cast<cRedstonePoweredEntity *>(*itr))) // Needs dynamic_cast due to multiple inheritance - { - return false; - } - return true; - } // for itr - m_BlockEntitites[] - - // Not found: - return false; -} - - - - bool cChunk::DoWithBeaconAt(int a_BlockX, int a_BlockY, int a_BlockZ, cBeaconCallback & a_Callback) { // The blockentity list is locked by the parent chunkmap's CS |