Added support for creation-time validation of generator options, closes #2717

This commit is contained in:
Dylan K. Taylor
2021-10-11 17:37:47 +01:00
parent 092aabeb97
commit 34f54750c8
8 changed files with 120 additions and 37 deletions

View File

@ -115,7 +115,7 @@ class FormatConverter{
$this->newProvider->generate($convertedOutput, $data->getName(), WorldCreationOptions::create()
//TODO: defaulting to NORMAL here really isn't very good behaviour, but it's consistent with what we already
//did previously; besides, WorldManager checks for unknown generators before this is reached anyway.
->setGeneratorClass(GeneratorManager::getInstance()->getGenerator($data->getGenerator()) ?? Normal::class)
->setGeneratorClass(GeneratorManager::getInstance()->getGenerator($data->getGenerator())?->getGeneratorClass() ?? Normal::class)
->setGeneratorOptions($data->getGeneratorOptions())
->setSeed($data->getSeed())
->setSpawnPosition($data->getSpawn())