MCPcopy Create free account
hub / github.com/cuberite/cuberite / TickQueuedBlocks

Method TickQueuedBlocks

src/World.cpp:2884–2908  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2882
2883
2884void cWorld::TickQueuedBlocks(void)
2885{
2886 if (m_BlockTickQueue.empty())
2887 {
2888 return;
2889 }
2890 m_BlockTickQueueCopy.clear();
2891 m_BlockTickQueue.swap(m_BlockTickQueueCopy);
2892
2893 for (std::vector<BlockTickQueueItem *>::iterator itr = m_BlockTickQueueCopy.begin(); itr != m_BlockTickQueueCopy.end(); itr++)
2894 {
2895 BlockTickQueueItem * Block = (*itr);
2896 Block->TicksToWait -= 1;
2897 if (Block->TicksToWait <= 0)
2898 {
2899 // TODO: Handle the case when the chunk is already unloaded
2900 m_ChunkMap->TickBlock(Block->X, Block->Y, Block->Z);
2901 delete Block; // We don't have to remove it from the vector, this will happen automatically on the next tick
2902 }
2903 else
2904 {
2905 m_BlockTickQueue.push_back(Block); // Keep the block in the queue
2906 }
2907 } // for itr - m_BlockTickQueueCopy[]
2908}
2909
2910
2911

Callers

nothing calls this directly

Calls 6

emptyMethod · 0.80
clearMethod · 0.80
swapMethod · 0.80
beginMethod · 0.80
endMethod · 0.80
TickBlockMethod · 0.45

Tested by

no test coverage detected