mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-05 19:37:17 +00:00
WorldManager: fixed loading the default world's spawn chunk when unloading the default world
yo dawg I heard you like loading and unloading so I put some loading inside your unloading so you can load while you unload
This commit is contained in:
parent
2a4111868c
commit
712ffb3e31
@ -154,12 +154,12 @@ class WorldManager{
|
||||
|
||||
$this->server->getLogger()->info($this->server->getLanguage()->translate(KnownTranslationFactory::pocketmine_level_unloading($world->getDisplayName())));
|
||||
try{
|
||||
$safeSpawn = $this->defaultWorld !== null ? $this->defaultWorld->getSafeSpawn() : null;
|
||||
$safeSpawn = $this->defaultWorld !== null && $this->defaultWorld !== $world ? $this->defaultWorld->getSafeSpawn() : null;
|
||||
}catch(WorldException $e){
|
||||
$safeSpawn = null;
|
||||
}
|
||||
foreach($world->getPlayers() as $player){
|
||||
if($world === $this->defaultWorld or $safeSpawn === null){
|
||||
if($safeSpawn === null){
|
||||
$player->disconnect("Forced default world unload");
|
||||
}else{
|
||||
$player->teleport($safeSpawn);
|
||||
|
Loading…
x
Reference in New Issue
Block a user