Exemplo n.º 1
0
 public function onRun(array $args, Player $player)
 {
     $mode = 0;
     $target = $player->getPosition();
     while (isset($args[0])) {
         $arg = array_shift($args);
         switch ($arg) {
             case "c":
             case "crosshair":
                 $target = WorldEditArt::getCrosshairTarget($player);
                 if (!$target instanceof Block) {
                     return "The block is too far/in the void/sky!";
                 }
                 break;
             case "v":
             case "view":
                 $mode = 1;
                 break;
         }
     }
     switch ($mode) {
         case 0:
             $this->getMain()->setAnchor($player, $target);
             return "Your anchor has been set to " . WorldEditArt::posToStr($target) . ".";
         case 1:
             $anchor = $this->getMain()->getAnchor($player);
             if (!$anchor instanceof Position) {
                 return "You don't have an anchor selected!";
             }
             return "Your anchor is at " . WorldEditArt::posToStr($anchor) . ".";
         default:
             return null;
     }
 }
 public function __toString()
 {
     return "a cuboid from " . WorldEditArt::v3ToStr($this->raw0) . " to " . WorldEditArt::posToStr($this->raw1);
 }
 public function __toString()
 {
     return "a sphere centered at " . WorldEditArt::posToStr($this->centre) . " of radius {$this->radius}";
 }
 public function __toString()
 {
     return "a cylinder of axis " . self::axisToStr($this->axis) . " based at " . WorldEditArt::posToStr($this->base) . " with {$this->height} blocks long, with a total of " . count($this->getPosList()) . " blocks.";
 }