예제 #1
0
 /**
  * @param $currentTick
  */
 public function onRun($currentTick)
 {
     if ($this->index < 0) {
         Cameraman::getInstance()->sendMessage($this->getCamera()->getTarget(), "message-travelling-started", ["slowness" => $this->getCamera()->getSlowness()]);
         $this->index = 0;
     }
     if ($this->index >= count($this->getCamera()->getMovements())) {
         $this->getCamera()->stop();
         return;
     }
     if (($location = $this->getCamera()->getMovement($this->index)->tick($this->getCamera()->getSlowness())) === null) {
         $this->index++;
         return;
     }
     $this->getCamera()->getTarget()->setPositionAndRotation($location, $location->getYaw(), $location->getPitch());
     Cameraman::sendMovePlayerPacket($this->getCamera()->getTarget());
 }
예제 #2
0
 public function onRun($currentTick)
 {
     Cameraman::getInstance()->saveConfigs();
 }
예제 #3
0
파일: Camera.php 프로젝트: Artide/Cameraman
 public function stop()
 {
     if ($this->isRunning()) {
         Cameraman::getInstance()->getServer()->getScheduler()->cancelTask($this->taskId);
         $this->taskId = -1;
         $this->getTarget()->teleport($this->location);
         $this->getTarget()->setGamemode($this->gamemode);
         Cameraman::getInstance()->sendMessage($this->getTarget(), "message-travelling-finished");
     }
 }