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

Method Initialize

src/Entities/Entity.cpp:134–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132
133
134bool cEntity::Initialize(cWorld * a_World)
135{
136 if (cPluginManager::Get()->CallHookSpawningEntity(*a_World, *this))
137 {
138 return false;
139 }
140
141 /*
142 // DEBUG:
143 LOGD("Initializing entity #%d (%s) at {%.02f, %.02f, %.02f}",
144 m_UniqueID, GetClass(), m_Pos.x, m_Pos.y, m_Pos.z
145 );
146 */
147
148 m_IsInitialized = true;
149 m_World = a_World;
150 m_World->AddEntity(this);
151
152 cPluginManager::Get()->CallHookSpawnedEntity(*a_World, *this);
153
154 // Spawn the entity on the clients:
155 a_World->BroadcastSpawnEntity(*this);
156
157 return true;
158}
159
160
161

Callers

nothing calls this directly

Calls 4

CallHookSpawnedEntityMethod · 0.80
AddEntityMethod · 0.45
BroadcastSpawnEntityMethod · 0.45

Tested by

no test coverage detected