public function __construct($res, Main $main, $isAsync = true) { $this->res = $res; $this->main = $main; $this->onPreRun(); if (!$isAsync) { $this->onRun(); $this->onCompletion($main->getServer()); } }
public function __construct($res, callable $onFinished, callable $statesSetter, Main $main, $isAsync = true) { $this->res = $res; $this->onFinished = $onFinished; $this->statesSetter = $statesSetter; $this->main = $main; if (!$isAsync) { $this->onRun(); $this->onCompletion($main->getServer()); } }
public function testPermissionSilent(CommandSender $sender) { if ($sender instanceof Position) { if ($this->getName() === "f" and !$this->main->isFactionWorld($sender->getLevel()->getName())) { return false; } } return parent::testPermissionSilent($sender); }
/** * @param Main $main * @return int The next unique faction ID */ public static function nextID(Main $main) { $fid = $main->getCleanSaveConfig()->get("next-fid"); $main->getCleanSaveConfig()->set("next-fid", $fid + 1); $main->getCleanSaveConfig()->save(); return $fid; }