From 688be0a404a4640778c01be6c7073d67b03198db Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 21 May 2022 18:46:38 +0100 Subject: [PATCH] Server: apply server.properties difficulty to newly generated worlds see #5057 jury is out on whether or not this should override difficulty on preexisting worlds, but it's non-controversial that it should apply at least to newly generated worlds. --- src/Server.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Server.php b/src/Server.php index 632adf519..8ab1a2408 100644 --- a/src/Server.php +++ b/src/Server.php @@ -1093,6 +1093,7 @@ class Server{ $creationOptions->setGeneratorClass($generatorClass); $creationOptions->setGeneratorOptions($generatorOptions); + $creationOptions->setDifficulty($this->getDifficulty()); if(isset($options["difficulty"]) && is_string($options["difficulty"])){ $creationOptions->setDifficulty(World::getDifficultyFromString($options["difficulty"])); } @@ -1127,6 +1128,7 @@ class Server{ if($convertedSeed !== null){ $creationOptions->setSeed($convertedSeed); } + $creationOptions->setDifficulty($this->getDifficulty()); $this->worldManager->generateWorld($default, $creationOptions); } }