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

Method QueueGenerateChunk

src/Generating/ChunkGenerator.cpp:101–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99
100
101void cChunkGenerator::QueueGenerateChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ)
102{
103 {
104 cCSLock Lock(m_CS);
105
106 // Check if it is already in the queue:
107 for (cChunkCoordsList::iterator itr = m_Queue.begin(); itr != m_Queue.end(); ++itr)
108 {
109 if ((itr->m_ChunkX == a_ChunkX) && (itr->m_ChunkY == a_ChunkY) && (itr->m_ChunkZ == a_ChunkZ))
110 {
111 // Already in the queue, bail out
112 return;
113 }
114 } // for itr - m_Queue[]
115
116 // Add to queue, issue a warning if too many:
117 if (m_Queue.size() >= QUEUE_WARNING_LIMIT)
118 {
119 LOGWARN("WARNING: Adding chunk [%i, %i] to generation queue; Queue is too big! (" SIZE_T_FMT ")", a_ChunkX, a_ChunkZ, m_Queue.size());
120 }
121 m_Queue.push_back(cChunkCoords(a_ChunkX, a_ChunkY, a_ChunkZ));
122 }
123
124 m_Event.Set();
125}
126
127
128

Callers 3

RegenerateChunkMethod · 0.80
GenerateChunkMethod · 0.80
LoadOneChunkMethod · 0.80

Calls 6

LOGWARNFunction · 0.85
cChunkCoordsClass · 0.85
beginMethod · 0.80
endMethod · 0.80
sizeMethod · 0.80
SetMethod · 0.45

Tested by

no test coverage detected