コード例 #1
0
 public function __construct($res, Main $main, $isAsync = true)
 {
     $this->res = $res;
     $this->main = $main;
     $this->onPreRun();
     if (!$isAsync) {
         $this->onRun();
         $this->onCompletion($main->getServer());
     }
 }
コード例 #2
0
 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());
     }
 }
コード例 #3
0
 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);
 }
コード例 #4
0
 /**
  * @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;
 }