/** * Create a warp or override its position * * @param string $warp * @param Position $pos * @param int $yaw * @param int $pitch * @return bool */ public function setWarp($warp, Position $pos, $yaw = 0, $pitch = 0) { if (!$this->validateName($warp, false)) { return false; } $this->warps[$warp] = $pos instanceof BaseLocation ? $pos : BaseLocation::fromPosition($warp, $pos instanceof Location ? $pos : Location::fromObject($pos, $pos->getLevel(), $yaw, $pitch)); return true; }
/** * @param $home * @param Location $pos * @return bool */ public function setHome($home, Location $pos) { if (!$this->getAPI()->validateName($home, false)) { return false; } $this->homes[$home] = $pos instanceof BaseLocation ? $pos : BaseLocation::fromPosition($home, $pos); return true; }