mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +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:
@ -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();
|
||||
|
Reference in New Issue
Block a user