Server: do not attempt to generate a new world if it already exists

This commit is contained in:
Dylan K. Taylor
2021-10-11 17:48:08 +01:00
parent 8fd475f87b
commit 01c0602043

View File

@@ -992,7 +992,7 @@ class Server{
}elseif(!is_array($options)){
continue;
}
if(!$this->worldManager->loadWorld($name, true)){
if(!$this->worldManager->loadWorld($name, true) && !$this->worldManager->isWorldGenerated($name)){
$creationOptions = WorldCreationOptions::create();
//TODO: error checking
@@ -1028,7 +1028,7 @@ class Server{
$default = "world";
$this->configGroup->setConfigString("level-name", "world");
}
if(!$this->worldManager->loadWorld($default, true)){
if(!$this->worldManager->loadWorld($default, true) && !$this->worldManager->isWorldGenerated($default)){
$generatorName = $this->configGroup->getConfigString("level-type");
$generatorOptions = $this->configGroup->getConfigString("generator-settings");
$generatorClass = $getGenerator($generatorName, $generatorOptions, $default);