mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
Default world might be null
This commit is contained in:
parent
027109075c
commit
e9f3cefe94
@ -150,9 +150,9 @@ class WorldManager{
|
||||
}
|
||||
|
||||
$this->server->getLogger()->info($this->server->getLanguage()->translateString("pocketmine.level.unloading", [$world->getDisplayName()]));
|
||||
$safeSpawn = $this->defaultWorld->getSafeSpawn();
|
||||
$safeSpawn = $this->defaultWorld !== null ? $this->defaultWorld->getSafeSpawn() : null;
|
||||
foreach($world->getPlayers() as $player){
|
||||
if($world === $this->defaultWorld or $this->defaultWorld === null){
|
||||
if($world === $this->defaultWorld or $safeSpawn === null){
|
||||
$player->disconnect("Forced default world unload");
|
||||
}else{
|
||||
$player->teleport($safeSpawn);
|
||||
|
Loading…
x
Reference in New Issue
Block a user