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

Method GetBlocks

src/ChunkMap.cpp:1475–1496  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1473
1474
1475bool cChunkMap::GetBlocks(sSetBlockVector & a_Blocks, bool a_ContinueOnFailure)
1476{
1477 bool res = true;
1478 cCSLock Lock(m_CSLayers);
1479 for (sSetBlockVector::iterator itr = a_Blocks.begin(); itr != a_Blocks.end(); ++itr)
1480 {
1481 cChunkPtr Chunk = GetChunk(itr->ChunkX, ZERO_CHUNK_Y, itr->ChunkZ );
1482 if ((Chunk == NULL) || !Chunk->IsValid())
1483 {
1484 if (!a_ContinueOnFailure)
1485 {
1486 return false;
1487 }
1488 res = false;
1489 continue;
1490 }
1491 int idx = cChunkDef::MakeIndexNoCheck(itr->x, itr->y, itr->z);
1492 itr->BlockType = Chunk->GetBlock(idx);
1493 itr->BlockMeta = Chunk->GetMeta(idx);
1494 }
1495 return res;
1496}
1497
1498
1499

Callers

nothing calls this directly

Calls 5

beginMethod · 0.80
endMethod · 0.80
GetMetaMethod · 0.80
IsValidMethod · 0.45
GetBlockMethod · 0.45

Tested by

no test coverage detected