PocketMine-MP 5.21.2 git-b2aa6396c3cc2cafdd815eacc360e1ad89599899
|
Public Member Functions | |
addAlias (string $name, string $alias) | |
addGenerator (string $class, string $name, \Closure $presetValidator, bool $overwrite=false) | |
getGenerator (string $name) | |
getGeneratorList () | |
getGeneratorName (string $class) | |
Definition at line 33 of file GeneratorManager.php.
pocketmine\world\generator\GeneratorManager::__construct | ( | ) |
Definition at line 42 of file GeneratorManager.php.
pocketmine\world\generator\GeneratorManager::addAlias | ( | string | $name, |
string | $alias ) |
Aliases an already-registered generator name to another name. Useful if you want to map a generator name to an existing generator without having to replicate the parameters.
Definition at line 87 of file GeneratorManager.php.
pocketmine\world\generator\GeneratorManager::addGenerator | ( | string | $class, |
string | $name, | ||
\Closure | $presetValidator, | ||
bool | $overwrite = false ) |
string | $class | Fully qualified name of class that extends \pocketmine\world\generator\Generator |
string | $name | Alias for this generator type that can be written in configs |
\Closure | $presetValidator | Callback to validate generator options for new worlds |
bool | $overwrite | Whether to force overwriting any existing registered generator with the same name |
@phpstan-param \Closure(string) : ?InvalidGeneratorOptionsException $presetValidator
@phpstan-param class-string<Generator> $class
InvalidArgumentException
Definition at line 72 of file GeneratorManager.php.
pocketmine\world\generator\GeneratorManager::getGenerator | ( | string | $name | ) |
Returns the generator entry of a registered Generator matching the given name, or null if not found.
Definition at line 111 of file GeneratorManager.php.
pocketmine\world\generator\GeneratorManager::getGeneratorList | ( | ) |
Returns a list of names for registered generators.
Definition at line 104 of file GeneratorManager.php.
pocketmine\world\generator\GeneratorManager::getGeneratorName | ( | string | $class | ) |
Returns the registered name of the given Generator class.
string | $class | Fully qualified name of class that extends \pocketmine\world\generator\Generator @phpstan-param class-string<Generator> $class |
InvalidArgumentException if the class type cannot be matched to a known alias
Definition at line 123 of file GeneratorManager.php.