public static function setupPermission(Warp $warp)
 {
     if (self::$baseWarpPerm == null) {
         self::$baseWarpPerm = Server::getInstance()->getPluginManager()->getPermission("simplewarp.warp");
     }
     $permission = new Permission(self::BASE_WARP_PERMISSION . "." . $warp->getName(), "Allow use of " . $warp->getName());
     //TODO correct default value
     Server::getInstance()->getPluginManager()->addPermission($permission);
     self::$baseWarpPerm->getChildren()[$permission->getName()] = true;
 }
 public function getDestination()
 {
     return $this->destination instanceof Destination ? $this->destination : $this->warp->getDestination();
 }
Example #3
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()];
 }