GeneratorManager
in package
Uses
SingletonTrait
Table of Contents
- $instance : self|null
- $list : array<string|int, GeneratorManagerEntry>
- __construct() : mixed
- addGenerator() : void
- getGenerator() : GeneratorManagerEntry|null
- Returns the generator entry of a registered Generator matching the given name, or null if not found.
- getGeneratorList() : array<string|int, string>
- Returns a list of names for registered generators.
- getGeneratorName() : string
- Returns the registered name of the given Generator class.
- getInstance() : self
- reset() : void
- setInstance() : void
- make() : self
Properties
$instance
private
static self|null
$instance
= null
$list
private
array<string|int, GeneratorManagerEntry>
$list
= []
name => classname mapping
Tags
Methods
__construct()
public
__construct() : mixed
Return values
mixed —addGenerator()
public
addGenerator(string $class, string $name, Closure $presetValidator[, bool $overwrite = false ]) : void
Parameters
- $class : string
-
Fully qualified name of class that extends \pocketmine\world\generator\Generator
- $name : string
-
Alias for this generator type that can be written in configs
- $presetValidator : Closure
-
Callback to validate generator options for new worlds
- $overwrite : bool = false
-
Whether to force overwriting any existing registered generator with the same name
Tags
Return values
void —getGenerator()
Returns the generator entry of a registered Generator matching the given name, or null if not found.
public
getGenerator(string $name) : GeneratorManagerEntry|null
Parameters
- $name : string
Return values
GeneratorManagerEntry|null —getGeneratorList()
Returns a list of names for registered generators.
public
getGeneratorList() : array<string|int, string>
Return values
array<string|int, string> —getGeneratorName()
Returns the registered name of the given Generator class.
public
getGeneratorName(string $class) : string
Parameters
- $class : string
-
Fully qualified name of class that extends \pocketmine\world\generator\Generator
Tags
Return values
string —getInstance()
public
static getInstance() : self
Return values
self —reset()
public
static reset() : void
Return values
void —setInstance()
public
static setInstance(self $instance) : void
Parameters
- $instance : self
Return values
void —make()
private
static make() : self