mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-11 20:35:15 +00:00
Level: Remove redundant duplicate condition in unloadChunk()
This commit is contained in:
parent
376a615634
commit
872df446bd
@ -2763,12 +2763,11 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
$this->server->getPluginManager()->callEvent($ev = new ChunkUnloadEvent($this, $chunk));
|
$this->server->getPluginManager()->callEvent($ev = new ChunkUnloadEvent($this, $chunk));
|
||||||
if($ev->isCancelled()){
|
if($ev->isCancelled()){
|
||||||
$this->timings->doChunkUnload->stopTiming();
|
$this->timings->doChunkUnload->stopTiming();
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
try{
|
try{
|
||||||
if($chunk !== null){
|
|
||||||
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);
|
||||||
@ -2780,12 +2779,12 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
$chunk->onUnload();
|
$chunk->onUnload();
|
||||||
}
|
|
||||||
}catch(\Throwable $e){
|
}catch(\Throwable $e){
|
||||||
$logger = $this->server->getLogger();
|
$logger = $this->server->getLogger();
|
||||||
$logger->error($this->server->getLanguage()->translateString("pocketmine.level.chunkUnloadError", [$e->getMessage()]));
|
$logger->error($this->server->getLanguage()->translateString("pocketmine.level.chunkUnloadError", [$e->getMessage()]));
|
||||||
$logger->logException($e);
|
$logger->logException($e);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
unset($this->chunks[$chunkHash]);
|
unset($this->chunks[$chunkHash]);
|
||||||
unset($this->chunkTickList[$chunkHash]);
|
unset($this->chunkTickList[$chunkHash]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user