Clean up generator preset handling

This commit is contained in:
Dylan K. Taylor
2021-04-13 20:19:53 +01:00
parent bfa1b4384b
commit 6ce15854af
8 changed files with 23 additions and 51 deletions

View File

@ -105,7 +105,7 @@ class FormatConverter{
$this->logger->info("Found previous conversion attempt, deleting...");
Filesystem::recursiveUnlink($convertedOutput);
}
$this->newProvider::generate($convertedOutput, $data->getName(), $data->getSeed(), GeneratorManager::getInstance()->getGenerator($data->getGenerator()), $data->getGeneratorOptions());
$this->newProvider::generate($convertedOutput, $data->getName(), $data->getSeed(), GeneratorManager::getInstance()->getGenerator($data->getGenerator()), ["preset" => $data->getGeneratorOptions()]);
/**
* @see WritableWorldProvider::__construct()

View File

@ -39,11 +39,7 @@ interface WorldData{
*/
public function getGenerator() : string;
/**
* @return mixed[]
* @phpstan-return array<string, mixed>
*/
public function getGeneratorOptions() : array;
public function getGeneratorOptions() : string;
public function getSeed() : int;

View File

@ -116,8 +116,8 @@ abstract class BaseNbtWorldData implements WorldData{
return $this->compoundTag->getString("generatorName", "DEFAULT");
}
public function getGeneratorOptions() : array{
return ["preset" => $this->compoundTag->getString("generatorOptions", "")];
public function getGeneratorOptions() : string{
return $this->compoundTag->getString("generatorOptions", "");
}
public function getSeed() : int{