mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-09 15:29:47 +00:00
GeneratorManager::getGeneratorName() now throws InvalidArgumentException on unregistered generator classes
the old behaviour allowed a bug in the world converter to go unnoticed.
This commit is contained in:
parent
3789f4d643
commit
2cad7166b1
@ -91,6 +91,7 @@ final class GeneratorManager{
|
|||||||
* @param string $class Fully qualified name of class that extends \pocketmine\level\generator\Generator
|
* @param string $class Fully qualified name of class that extends \pocketmine\level\generator\Generator
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
|
* @throws \InvalidArgumentException if the class type cannot be matched to a known alias
|
||||||
*/
|
*/
|
||||||
public static function getGeneratorName(string $class) : string{
|
public static function getGeneratorName(string $class) : string{
|
||||||
foreach(self::$list as $name => $c){
|
foreach(self::$list as $name => $c){
|
||||||
@ -99,7 +100,7 @@ final class GeneratorManager{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return "unknown";
|
throw new \InvalidArgumentException("Generator class $class is not registered");
|
||||||
}
|
}
|
||||||
|
|
||||||
private function __construct(){
|
private function __construct(){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user