本文整理汇总了PHP中pocketmine\Server::generateLevel方法的典型用法代码示例。如果您正苦于以下问题:PHP Server::generateLevel方法的具体用法?PHP Server::generateLevel怎么用?PHP Server::generateLevel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pocketmine\Server
的用法示例。
在下文中一共展示了Server::generateLevel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(array $args, Main $main)
{
$this->name = $args["name"];
$this->motto = $args["motto"];
$this->id = $args["id"];
$this->founder = $args["founder"];
$this->ranks = $args["ranks"];
$this->defaultRank = $args["default-rank"];
$this->allyRank = $args["ally-rank"];
$this->truceRank = $args["truce-rank"];
$this->stdRank = $args["std-rank"];
$this->members = $args["members"];
$this->lastActive = $args["last-active"];
$this->chunks = $args["chunks"];
$this->homes = $args["homes"];
$this->main = $main;
$this->whitelist = $args["whitelist"];
$this->reputation = isset($args["reputation"]) ? $args["reputation"] : 0;
$this->server = $this->main->getServer();
$levels = [];
foreach ($this->chunks as $chunk) {
$level = $chunk->getLevel();
if (!isset($levels[$level])) {
$levels[] = $level;
if (!$this->server->isLevelLoaded($level)) {
if (!$this->server->isLevelGenerated($this->server->loadLevel($level))) {
$this->server->generateLevel($level, $this->main->getLevelGenerationSeed());
}
$this->server->loadLevel($level);
}
}
}
$this->initializeXEconEntity($main->getXEcon($this->server));
}