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

Method UnboundedRelGetBlockLights

src/Chunk.cpp:1193–1210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1191
1192
1193bool cChunk::UnboundedRelGetBlockLights(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE & a_BlockLight, NIBBLETYPE & a_SkyLight) const
1194{
1195 if ((a_RelY < 0) || (a_RelY >= cChunkDef::Height))
1196 {
1197 LOGWARNING("%s: requesting a block with a_RelY out of range: %d", __FUNCTION__, a_RelY);
1198 return false;
1199 }
1200 cChunk * Chunk = GetRelNeighborChunkAdjustCoords(a_RelX, a_RelZ);
1201 if ((Chunk == NULL) || !Chunk->IsValid())
1202 {
1203 // The chunk is not available, bail out
1204 return false;
1205 }
1206 int idx = Chunk->MakeIndex(a_RelX, a_RelY, a_RelZ);
1207 a_BlockLight = Chunk->GetBlockLight(idx);
1208 a_SkyLight = Chunk->GetSkyLight(idx);
1209 return true;
1210}
1211
1212
1213

Callers

nothing calls this directly

Calls 4

GetSkyLightMethod · 0.80
IsValidMethod · 0.45
MakeIndexMethod · 0.45
GetBlockLightMethod · 0.45

Tested by

no test coverage detected