Get rid of catch-all on chunk unload

god only knows what the fuck is going on in here that warrants this catch-all... so let's remove it and find out!
This commit is contained in:
Dylan K. Taylor 2018-12-29 16:37:59 +00:00
parent cd80ae00d4
commit 5ecc5ed7e0

View File

@ -2835,23 +2835,17 @@ class Level implements ChunkManager, Metadatable{
return false;
}
try{
if($trySave and $this->getAutoSave() and $chunk->isGenerated()){
if($chunk->hasChanged() or count($chunk->getTiles()) > 0 or count($chunk->getSavableEntities()) > 0){
$this->provider->saveChunk($chunk);
}
if($trySave and $this->getAutoSave() and $chunk->isGenerated()){
if($chunk->hasChanged() or count($chunk->getTiles()) > 0 or count($chunk->getSavableEntities()) > 0){
$this->provider->saveChunk($chunk);
}
foreach($this->getChunkLoaders($x, $z) as $loader){
$loader->onChunkUnloaded($chunk);
}
$chunk->onUnload();
}catch(\Throwable $e){
$logger = $this->server->getLogger();
$logger->error($this->server->getLanguage()->translateString("pocketmine.level.chunkUnloadError", [$e->getMessage()]));
$logger->logException($e);
}
foreach($this->getChunkLoaders($x, $z) as $loader){
$loader->onChunkUnloaded($chunk);
}
$chunk->onUnload();
}
unset($this->chunks[$chunkHash]);