mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-20 07:39:42 +00:00
GeneratorManager::getGenerator() now returns null for unknown generator aliases
instead of returning Normal::class (indistinguishable from successful match) or throwing an exception (pain in the ass to handle).
This commit is contained in:
@@ -220,9 +220,8 @@ class WorldManager{
|
||||
)));
|
||||
return false;
|
||||
}
|
||||
try{
|
||||
GeneratorManager::getInstance()->getGenerator($provider->getWorldData()->getGenerator(), true);
|
||||
}catch(\InvalidArgumentException $e){
|
||||
|
||||
if(GeneratorManager::getInstance()->getGenerator($provider->getWorldData()->getGenerator()) === null){
|
||||
$this->server->getLogger()->error($this->server->getLanguage()->translate(KnownTranslationFactory::pocketmine_level_loadError(
|
||||
$name,
|
||||
KnownTranslationFactory::pocketmine_level_unknownGenerator($provider->getWorldData()->getGenerator())
|
||||
|
Reference in New Issue
Block a user