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

Method OnChunkGenerated

src/World.cpp:3157–3173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3155
3156
3157void cWorld::cChunkGeneratorCallbacks::OnChunkGenerated(cChunkDesc & a_ChunkDesc)
3158{
3159 cChunkDef::BlockNibbles BlockMetas;
3160 a_ChunkDesc.CompressBlockMetas(BlockMetas);
3161
3162 m_World->SetChunkData(
3163 a_ChunkDesc.GetChunkX(), a_ChunkDesc.GetChunkZ(),
3164 a_ChunkDesc.GetBlockTypes(), BlockMetas,
3165 NULL, NULL, // We don't have lighting, chunk will be lighted when needed
3166 &a_ChunkDesc.GetHeightMap(), &a_ChunkDesc.GetBiomeMap(),
3167 a_ChunkDesc.GetEntities(), a_ChunkDesc.GetBlockEntities(),
3168 true
3169 );
3170
3171 // Save the chunk right after generating, so that we don't have to generate it again on next run
3172 m_World->GetStorage().QueueSaveChunk(a_ChunkDesc.GetChunkX(), 0, a_ChunkDesc.GetChunkZ());
3173}
3174
3175
3176

Callers

nothing calls this directly

Calls 6

CompressBlockMetasMethod · 0.80
QueueSaveChunkMethod · 0.80
SetChunkDataMethod · 0.45
GetChunkXMethod · 0.45
GetChunkZMethod · 0.45
GetBlockTypesMethod · 0.45

Tested by

no test coverage detected