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

Method UnboundedRelGetBlock

src/Chunk.cpp:1088–1103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1086
1087
1088bool cChunk::UnboundedRelGetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta) const
1089{
1090 if ((a_RelY < 0) || (a_RelY >= cChunkDef::Height))
1091 {
1092 LOGWARNING("%s: requesting a block with a_RelY out of range: %d", __FUNCTION__, a_RelY);
1093 return false;
1094 }
1095 cChunk * Chunk = GetRelNeighborChunkAdjustCoords(a_RelX, a_RelZ);
1096 if ((Chunk == NULL) || !Chunk->IsValid())
1097 {
1098 // The chunk is not available, bail out
1099 return false;
1100 }
1101 Chunk->GetBlockTypeMeta(a_RelX, a_RelY, a_RelZ, a_BlockType, a_BlockMeta);
1102 return true;
1103}
1104
1105
1106

Callers 11

GetBurnStepTimeMethod · 0.80
CanStartFireInBlockMethod · 0.80
CheckTributariesMethod · 0.80
SpreadToNeighborMethod · 0.80
HardenBlockMethod · 0.80
CalculateFlowCostMethod · 0.80
GetMaxMetaMethod · 0.80
CanBeAtMethod · 0.80
CanBeAtMethod · 0.80
CanBeAtMethod · 0.80

Calls 2

IsValidMethod · 0.45
GetBlockTypeMetaMethod · 0.45

Tested by

no test coverage detected