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

Method GetChunkNoGen

src/ChunkMap.cpp:165–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163
164
165cChunkPtr cChunkMap::GetChunkNoGen( int a_ChunkX, int a_ChunkY, int a_ChunkZ )
166{
167 // No need to lock m_CSLayers, since it's already locked by the operation that called us
168 cChunkLayer * Layer = GetLayerForChunk( a_ChunkX, a_ChunkZ );
169 if (Layer == NULL)
170 {
171 // An error must have occurred, since layers are automatically created if they don't exist
172 return NULL;
173 }
174
175 cChunkPtr Chunk = Layer->GetChunk(a_ChunkX, a_ChunkY, a_ChunkZ);
176 if (Chunk == NULL)
177 {
178 return NULL;
179 }
180 if (!(Chunk->IsValid()))
181 {
182 m_World->GetStorage().QueueLoadChunk(a_ChunkX, a_ChunkY, a_ChunkZ, false);
183 }
184
185 return Chunk;
186}
187
188
189

Callers

nothing calls this directly

Calls 3

GetChunkMethod · 0.80
QueueLoadChunkMethod · 0.80
IsValidMethod · 0.45

Tested by

no test coverage detected