mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
WorldManager: don't recalculate the spawn point for every player teleported during world unload
This commit is contained in:
parent
624495f4d3
commit
027109075c
@ -150,11 +150,12 @@ class WorldManager{
|
||||
}
|
||||
|
||||
$this->server->getLogger()->info($this->server->getLanguage()->translateString("pocketmine.level.unloading", [$world->getDisplayName()]));
|
||||
$safeSpawn = $this->defaultWorld->getSafeSpawn();
|
||||
foreach($world->getPlayers() as $player){
|
||||
if($world === $this->defaultWorld or $this->defaultWorld === null){
|
||||
$player->disconnect("Forced default world unload");
|
||||
}else{
|
||||
$player->teleport($this->defaultWorld->getSafeSpawn());
|
||||
$player->teleport($safeSpawn);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user