mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-06 10:01:53 +00:00
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:
parent
cd80ae00d4
commit
5ecc5ed7e0
@ -2835,23 +2835,17 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
try{
|
if($trySave and $this->getAutoSave() and $chunk->isGenerated()){
|
||||||
if($trySave and $this->getAutoSave() and $chunk->isGenerated()){
|
if($chunk->hasChanged() or count($chunk->getTiles()) > 0 or count($chunk->getSavableEntities()) > 0){
|
||||||
if($chunk->hasChanged() or count($chunk->getTiles()) > 0 or count($chunk->getSavableEntities()) > 0){
|
$this->provider->saveChunk($chunk);
|
||||||
$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]);
|
unset($this->chunks[$chunkHash]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user