mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-25 21:04:06 +00:00
LevelManager::generateLevel(): avoid multiple return points
this could cause unexpected results if additional code is added after background generation in the future.
This commit is contained in:
parent
7c7f42eba6
commit
854c3a816c
@ -292,10 +292,7 @@ class LevelManager{
|
|||||||
|
|
||||||
(new LevelLoadEvent($level))->call();
|
(new LevelLoadEvent($level))->call();
|
||||||
|
|
||||||
if(!$backgroundGeneration){
|
if($backgroundGeneration){
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->server->getLogger()->notice($this->server->getLanguage()->translateString("pocketmine.level.backgroundGeneration", [$name]));
|
$this->server->getLogger()->notice($this->server->getLanguage()->translateString("pocketmine.level.backgroundGeneration", [$name]));
|
||||||
|
|
||||||
$spawnLocation = $level->getSpawnLocation();
|
$spawnLocation = $level->getSpawnLocation();
|
||||||
@ -320,6 +317,7 @@ class LevelManager{
|
|||||||
Level::getXZ($index, $chunkX, $chunkZ);
|
Level::getXZ($index, $chunkX, $chunkZ);
|
||||||
$level->populateChunk($chunkX, $chunkZ, true);
|
$level->populateChunk($chunkX, $chunkZ, true);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user