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

Method AddEntity

src/ChunkMap.cpp:1655–1667  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1653
1654
1655void cChunkMap::AddEntity(cEntity * a_Entity)
1656{
1657 cCSLock Lock(m_CSLayers);
1658 cChunkPtr Chunk = GetChunkNoGen(a_Entity->GetChunkX(), ZERO_CHUNK_Y, a_Entity->GetChunkZ());
1659 if ((Chunk == NULL) && !Chunk->IsValid())
1660 {
1661 LOGWARNING("Entity at %p (%s, ID %d) spawning in a non-existent chunk, the entity is lost.",
1662 a_Entity, a_Entity->GetClass(), a_Entity->GetUniqueID()
1663 );
1664 return;
1665 }
1666 Chunk->AddEntity(a_Entity);
1667}
1668
1669
1670

Callers

nothing calls this directly

Calls 5

GetClassMethod · 0.80
GetChunkXMethod · 0.45
GetChunkZMethod · 0.45
IsValidMethod · 0.45
GetUniqueIDMethod · 0.45

Tested by

no test coverage detected