mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-05 17:41:46 +00:00
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.
This commit is contained in:
parent
33e6b63fe5
commit
688be0a404
@ -1093,6 +1093,7 @@ class Server{
|
|||||||
$creationOptions->setGeneratorClass($generatorClass);
|
$creationOptions->setGeneratorClass($generatorClass);
|
||||||
$creationOptions->setGeneratorOptions($generatorOptions);
|
$creationOptions->setGeneratorOptions($generatorOptions);
|
||||||
|
|
||||||
|
$creationOptions->setDifficulty($this->getDifficulty());
|
||||||
if(isset($options["difficulty"]) && is_string($options["difficulty"])){
|
if(isset($options["difficulty"]) && is_string($options["difficulty"])){
|
||||||
$creationOptions->setDifficulty(World::getDifficultyFromString($options["difficulty"]));
|
$creationOptions->setDifficulty(World::getDifficultyFromString($options["difficulty"]));
|
||||||
}
|
}
|
||||||
@ -1127,6 +1128,7 @@ class Server{
|
|||||||
if($convertedSeed !== null){
|
if($convertedSeed !== null){
|
||||||
$creationOptions->setSeed($convertedSeed);
|
$creationOptions->setSeed($convertedSeed);
|
||||||
}
|
}
|
||||||
|
$creationOptions->setDifficulty($this->getDifficulty());
|
||||||
$this->worldManager->generateWorld($default, $creationOptions);
|
$this->worldManager->generateWorld($default, $creationOptions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user