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

Method SpawnMobFinalize

src/World.cpp:2959–2978  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2957
2958
2959int cWorld::SpawnMobFinalize(cMonster * a_Monster)
2960{
2961 if (!a_Monster)
2962 return -1;
2963 a_Monster->SetHealth(a_Monster->GetMaxHealth());
2964 if (cPluginManager::Get()->CallHookSpawningMonster(*this, *a_Monster))
2965 {
2966 delete a_Monster;
2967 return -1;
2968 }
2969 if (!a_Monster->Initialize(this))
2970 {
2971 delete a_Monster;
2972 return -1;
2973 }
2974 BroadcastSpawnEntity(*a_Monster);
2975 cPluginManager::Get()->CallHookSpawnedMonster(*this, *a_Monster);
2976
2977 return a_Monster->GetUniqueID();
2978}
2979
2980
2981

Callers

nothing calls this directly

Calls 6

SetHealthMethod · 0.80
GetMaxHealthMethod · 0.80
InitializeMethod · 0.45
GetUniqueIDMethod · 0.45

Tested by

no test coverage detected