mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-15 07:55:31 +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()]));
|
$this->server->getLogger()->info($this->server->getLanguage()->translateString("pocketmine.level.unloading", [$world->getDisplayName()]));
|
||||||
|
$safeSpawn = $this->defaultWorld->getSafeSpawn();
|
||||||
foreach($world->getPlayers() as $player){
|
foreach($world->getPlayers() as $player){
|
||||||
if($world === $this->defaultWorld or $this->defaultWorld === null){
|
if($world === $this->defaultWorld or $this->defaultWorld === null){
|
||||||
$player->disconnect("Forced default world unload");
|
$player->disconnect("Forced default world unload");
|
||||||
}else{
|
}else{
|
||||||
$player->teleport($this->defaultWorld->getSafeSpawn());
|
$player->teleport($safeSpawn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user