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

Method TryGetHeight

src/ChunkMap.cpp:1046–1059  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1044
1045
1046bool cChunkMap::TryGetHeight(int a_BlockX, int a_BlockZ, int & a_Height)
1047{
1048 // Returns false if chunk not loaded / generated
1049 cCSLock Lock(m_CSLayers);
1050 int ChunkX, ChunkZ, BlockY = 0;
1051 cChunkDef::AbsoluteToRelative(a_BlockX, BlockY, a_BlockZ, ChunkX, ChunkZ);
1052 cChunkPtr Chunk = GetChunkNoLoad(ChunkX, ZERO_CHUNK_Y, ChunkZ);
1053 if ((Chunk == NULL) || !Chunk->IsValid())
1054 {
1055 return false;
1056 }
1057 a_Height = Chunk->GetHeight(a_BlockX, a_BlockZ);
1058 return true;
1059}
1060
1061
1062

Callers

nothing calls this directly

Calls 2

IsValidMethod · 0.45
GetHeightMethod · 0.45

Tested by

no test coverage detected