From 230af75d102c8d0d64030a52bd746263d4792241 Mon Sep 17 00:00:00 2001 From: Kevin Andrews Date: Tue, 29 Aug 2017 18:36:05 -0300 Subject: [PATCH] Update Main.php --- src/aliuly/manyworlds/Main.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/aliuly/manyworlds/Main.php b/src/aliuly/manyworlds/Main.php index 6b2d3f4..47c4fd9 100644 --- a/src/aliuly/manyworlds/Main.php +++ b/src/aliuly/manyworlds/Main.php @@ -22,9 +22,14 @@ use aliuly\manyworlds\common\BasicHelp; class Main extends BasicPlugin implements CommandExecutor { + /** @var bool */ public $canUnload = false; + /** @var TeleportManager */ private $tpMgr = null; + /** + * @return void + */ public function onEnable() { // We don't really need this... //if (!is_dir($this->getDataFolder())) mkdir($this->getDataFolder()); @@ -53,6 +58,12 @@ public function onEnable() { $this->modules[] = new BasicHelp($this); } + /** + * @param CommandSender $c + * @param string $world + * + * @return bool + */ public function autoLoad(CommandSender $c,$world) { if ($this->getServer()->isLevelLoaded($world)) return true; if($c !== null && !MPMU::access($c, "mw.cmd.world.load")) return false; @@ -72,6 +83,14 @@ public function autoLoad(CommandSender $c,$world) { // Command dispatcher // ////////////////////////////////////////////////////////////////////// + /** + * @param CommandSender $sender + * @param Command $cmd + * @param string $label + * @param string[] $args + * + * @return bool + */ public function onCommand(CommandSender $sender, Command $cmd, $label, array $args) { if ($cmd->getName() != "manyworlds") return false; return $this->dispatchSCmd($sender,$cmd,$args); @@ -79,6 +98,12 @@ public function onCommand(CommandSender $sender, Command $cmd, $label, array $ar // // Deprecated Public API // + /** + * @param Player $pl + * @param Position $pos + * + * @return bool + */ public function mwtp($pl,$pos) { if ($this->tpMgr && ($pos instanceof Position)) { // Using ManyWorlds for teleporting... @@ -90,6 +115,13 @@ public function mwtp($pl,$pos) { $pl->teleport($pos); return true; } + /** + * @param Player $player + * @param string $world + * @param Position $spawn + * + * @return bool|void + */ public function teleport($player,$world,$spawn=null) { if ($this->tpMgr) { return $this->tpMgr->teleport($player,$world,$spawn);