Added worlds directive to pocketmine.yml to load extra worlds or use a plugin-provided generator

This commit is contained in:
Shoghi Cervantes
2014-08-01 12:24:08 +02:00
parent d10274ca7c
commit 26ec562fbf
3 changed files with 29 additions and 5 deletions

View File

@ -30,7 +30,7 @@ abstract class Generator{
private static $list = [];
public static function addGenerator($object, $name){
if(is_subclass_of($object, "pocketmine\\level\\generator\\Generator") and !isset(Generator::$list[$name])){
if(is_subclass_of($object, "pocketmine\\level\\generator\\Generator") and !isset(Generator::$list[$name = strtolower($name)])){
Generator::$list[$name] = $object;
return true;
@ -40,7 +40,7 @@ abstract class Generator{
}
public static function getGenerator($name){
if(isset(Generator::$list[$name])){
if(isset(Generator::$list[$name = strtolower($name)])){
return Generator::$list[$name];
}