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

Method DigBlock

src/ChunkMap.cpp:1502–1521  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1500
1501
1502bool cChunkMap::DigBlock(int a_X, int a_Y, int a_Z)
1503{
1504 int PosX = a_X, PosY = a_Y, PosZ = a_Z, ChunkX, ChunkZ;
1505
1506 cChunkDef::AbsoluteToRelative( PosX, PosY, PosZ, ChunkX, ChunkZ );
1507
1508 {
1509 cCSLock Lock(m_CSLayers);
1510 cChunkPtr DestChunk = GetChunk( ChunkX, ZERO_CHUNK_Y, ChunkZ );
1511 if ((DestChunk == NULL) || !DestChunk->IsValid())
1512 {
1513 return false;
1514 }
1515
1516 DestChunk->SetBlock(PosX, PosY, PosZ, E_BLOCK_AIR, 0 );
1517 m_World->GetSimulatorManager()->WakeUp(a_X, a_Y, a_Z, DestChunk);
1518 }
1519
1520 return true;
1521}
1522
1523
1524

Callers

nothing calls this directly

Calls 4

GetSimulatorManagerMethod · 0.80
IsValidMethod · 0.45
SetBlockMethod · 0.45
WakeUpMethod · 0.45

Tested by

no test coverage detected