mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 16:51:42 +00:00
World: do not warn about leaked Player entities during world unload
this raises false-positives during shutdown if players were online. The fact that the player entity leans on the World to clean up after it is slightly problematic, but I'm not sure what else to do about it for now.
This commit is contained in:
parent
6f8261f26a
commit
e0e19c67ef
@ -525,12 +525,17 @@ class World implements ChunkManager{
|
||||
}
|
||||
foreach($this->entitiesByChunk as $chunkHash => $entities){
|
||||
self::getXZ($chunkHash, $chunkX, $chunkZ);
|
||||
if(count($entities) !== 0){
|
||||
$this->logger->warning(count($entities) . " entities found in ungenerated chunk $chunkX $chunkZ, they won't be saved!");
|
||||
}
|
||||
|
||||
$leakedEntities = 0;
|
||||
foreach($entities as $entity){
|
||||
if(!$entity->isFlaggedForDespawn()){
|
||||
$leakedEntities++;
|
||||
}
|
||||
$entity->close();
|
||||
}
|
||||
if($leakedEntities !== 0){
|
||||
$this->logger->warning("$leakedEntities leaked entities found in ungenerated chunk $chunkX $chunkZ during unload, they won't be saved!");
|
||||
}
|
||||
}
|
||||
|
||||
$this->save();
|
||||
|
Loading…
x
Reference in New Issue
Block a user