getLevelByName() 공개 메소드

public getLevelByName ( $name ) : Level
$name
리턴 pocketmine\level\Level
예제 #1
0
 /**
  * Get a world name and return a level object.  Loads levels as needed
  *
  * @param Server $server
  * @param str $world
  * @return Level|null
  */
 public static function getLevelByName(Server $server, $world)
 {
     if (!$server->isLevelGenerated($world)) {
         return null;
     }
     if (!$server->isLevelLoaded($world)) {
         $server->loadLevel($world);
     }
     return $server->getLevelByName($world);
 }
예제 #2
0
 public function getLevel(Server $server)
 {
     return $server->getLevelByName($this->levelName);
 }