mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 11:57:10 +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())));
|
$this->server->getLogger()->info($this->server->getLanguage()->translate(KnownTranslationFactory::pocketmine_level_unloading($world->getDisplayName())));
|
||||||
try{
|
try{
|
||||||
$safeSpawn = $this->defaultWorld !== null ? $this->defaultWorld->getSafeSpawn() : null;
|
$safeSpawn = $this->defaultWorld !== null && $this->defaultWorld !== $world ? $this->defaultWorld->getSafeSpawn() : null;
|
||||||
}catch(WorldException $e){
|
}catch(WorldException $e){
|
||||||
$safeSpawn = null;
|
$safeSpawn = null;
|
||||||
}
|
}
|
||||||
foreach($world->getPlayers() as $player){
|
foreach($world->getPlayers() as $player){
|
||||||
if($world === $this->defaultWorld or $safeSpawn === null){
|
if($safeSpawn === null){
|
||||||
$player->disconnect("Forced default world unload");
|
$player->disconnect("Forced default world unload");
|
||||||
}else{
|
}else{
|
||||||
$player->teleport($safeSpawn);
|
$player->teleport($safeSpawn);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user