mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
getSafeSpawn() may throw if the target terrain is not generated
This commit is contained in:
parent
e9f3cefe94
commit
2ce6a87d05
@ -150,7 +150,11 @@ class WorldManager{
|
||||
}
|
||||
|
||||
$this->server->getLogger()->info($this->server->getLanguage()->translateString("pocketmine.level.unloading", [$world->getDisplayName()]));
|
||||
$safeSpawn = $this->defaultWorld !== null ? $this->defaultWorld->getSafeSpawn() : null;
|
||||
try{
|
||||
$safeSpawn = $this->defaultWorld !== null ? $this->defaultWorld->getSafeSpawn() : null;
|
||||
}catch(WorldException $e){
|
||||
$safeSpawn = null;
|
||||
}
|
||||
foreach($world->getPlayers() as $player){
|
||||
if($world === $this->defaultWorld or $safeSpawn === null){
|
||||
$player->disconnect("Forced default world unload");
|
||||
|
Loading…
x
Reference in New Issue
Block a user