Пример #1
0
 public function getDestination()
 {
     return $this->destination instanceof Destination ? $this->destination : $this->warp->getDestination();
 }
Пример #2
0
 /**
  * In order to pass data to a DataStore
  * a key is needed. Typically one should
  * use $warp->getName()
  * @param Warp $warp
  * @return array
  */
 protected function warpToData(Warp $warp)
 {
     if ($warp->getDestination()->isInternal()) {
         //TODO implement yaw and pitch
         $pos = $warp->getDestination()->getPosition();
         return ["x" => $pos->getX(), "y" => $pos->getY(), "z" => $pos->getZ(), "level" => $pos instanceof WeakPosition ? $pos->getLevelName() : $pos->getLevel()->getName(), "public" => $warp->isPublic()];
     }
     return ["address" => $warp->getDestination()->getAddress(), "port" => $warp->getDestination()->getPort(), "public" => $warp->isPublic()];
 }