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

Method UnboundedRelSetBlock

src/Chunk.cpp:1216–1231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1214
1215
1216bool cChunk::UnboundedRelSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
1217{
1218 if ((a_RelY < 0) || (a_RelY > cChunkDef::Height))
1219 {
1220 LOGWARNING("UnboundedRelSetBlock(): requesting a block with a_RelY out of range: %d", a_RelY);
1221 return false;
1222 }
1223 cChunk * Chunk = GetRelNeighborChunkAdjustCoords(a_RelX, a_RelZ);
1224 if ((Chunk == NULL) || !Chunk->IsValid())
1225 {
1226 // The chunk is not available, bail out
1227 return false;
1228 }
1229 Chunk->SetBlock(a_RelX, a_RelY, a_RelZ, a_BlockType, a_BlockMeta);
1230 return true;
1231}
1232
1233
1234

Callers 5

TrySpreadFireMethod · 0.80
SpreadToNeighborMethod · 0.80
HardenBlockMethod · 0.80
OnUpdateMethod · 0.80
TryStartFireNearMethod · 0.80

Calls 2

IsValidMethod · 0.45
SetBlockMethod · 0.45

Tested by

no test coverage detected