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

Method GetBlockMeta

src/ChunkMap.cpp:1177–1200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1175
1176
1177NIBBLETYPE cChunkMap::GetBlockMeta(int a_BlockX, int a_BlockY, int a_BlockZ)
1178{
1179 // First check if it isn't queued in the m_FastSetBlockQueue:
1180 {
1181 cCSLock Lock(m_CSFastSetBlock);
1182 for (sSetBlockList::iterator itr = m_FastSetBlockQueue.begin(); itr != m_FastSetBlockQueue.end(); ++itr)
1183 {
1184 if ((itr->x == a_BlockX) && (itr->y == a_BlockY) && (itr->z == a_BlockZ))
1185 {
1186 return itr->BlockMeta;
1187 }
1188 } // for itr - m_FastSetBlockQueue[]
1189 }
1190 int ChunkX, ChunkZ;
1191 cChunkDef::AbsoluteToRelative(a_BlockX, a_BlockY, a_BlockZ, ChunkX, ChunkZ );
1192
1193 cCSLock Lock(m_CSLayers);
1194 cChunkPtr Chunk = GetChunk( ChunkX, ZERO_CHUNK_Y, ChunkZ );
1195 if ((Chunk != NULL) && Chunk->IsValid() )
1196 {
1197 return Chunk->GetMeta(a_BlockX, a_BlockY, a_BlockZ);
1198 }
1199 return 0;
1200}
1201
1202
1203

Callers 1

DoExplosionAtMethod · 0.45

Calls 4

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

Tested by

no test coverage detected