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

Method ForEachChest

src/Chunk.cpp:1967–1983  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1965
1966
1967bool cChunk::ForEachChest(cChestCallback & a_Callback)
1968{
1969 // The blockentity list is locked by the parent chunkmap's CS
1970 for (cBlockEntityList::iterator itr = m_BlockEntities.begin(), itr2 = itr; itr != m_BlockEntities.end(); itr = itr2)
1971 {
1972 ++itr2;
1973 if ((*itr)->GetBlockType() != E_BLOCK_CHEST)
1974 {
1975 continue;
1976 }
1977 if (a_Callback.Item((cChestEntity *)*itr))
1978 {
1979 return false;
1980 }
1981 } // for itr - m_BlockEntitites[]
1982 return true;
1983}
1984
1985
1986

Callers 1

ForEachChestInChunkMethod · 0.80

Calls 4

beginMethod · 0.80
endMethod · 0.80
GetBlockTypeMethod · 0.45
ItemMethod · 0.45

Tested by

no test coverage detected