public function onEnable() { $this->saveDefaultConfig(); $this->single = $this->getConfig()->get("single", false); if ($this->single) { $this->getServer()->getScheduler()->scheduleDelayedTask(new CallbackPluginTask($this, function () { if (count($this->loadedGames) === 0) { $this->getLogger()->critical("No games loaded"); $this->getServer()->getPluginManager()->disablePlugin($this); } }), 1); } else { foreach ($this->joinMethods as $method) { $m = JoinMethod::get($this, $method); if ($m !== null) { $this->joinMethods[] = $m; } } new JoinListener($this); $this->hubModule = new HubModule($this); } }
public function __construct($data) { parent::__construct($data); $this->key = isset($this->key) ? Item::get($this->key["itemId"], $this->key["damage"]) : null; $this->lock = isset($this->lock) ? new Vector3(...$this->lock) : null; }
public function __construct($data) { parent::__construct($data); $this->bb = new AxisAlignedBB(min($this->start[0], $this->end[0]), min($this->start[1], $this->end[1]), min($this->start[2], $this->end[2]), max($this->start[0], $this->end[0]) + 1, max($this->start[1], $this->end[1]), max($this->start[2], $this->end[2]) + 1); }