/**
* Really starts the duel after countdown
*/
public function startDuel()
{
Server::getInstance()->getScheduler()->cancelTask($this->countdownTaskHandler->getTaskId());
$player1 = $this->players[0];
$player2 = $this->players[1];
$pos_player1 = Position::fromObject($this->position, $this->position->getLevel());
$pos_player1->x += self::PLAYER_1_OFFSET_X;
$pos_player2 = Position::fromObject($this->position, $this->position->getLevel());
$pos_player2->x += self::PLAYER_2_OFFSET_X;
$player1->teleport($pos_player1, 90, 0);
$player2->teleport($pos_player2, -90, 0);
// Fix start time
$this->startTime = new DateTime('now');
$player1->sendTip(TextFormat::RED . "You are strarting a duel !");
$player1->sendMessage(" ");
$player1->sendMessage(TextFormat::RED . TextFormat::BOLD . "++++++++=++++++++");
$player1->sendMessage(TextFormat::AQUA . ">" . TextFormat::RESET . " You're starting a duel against : " . $player2->getName() . " !");
$player1->sendMessage(TextFormat::AQUA . ">" . TextFormat::RESET . " You have 3min !");
$player1->sendMessage(TextFormat::AQUA . ">" . TextFormat::RESET . " Good luck :) !");
$player1->sendMessage(TextFormat::RED . TextFormat::BOLD . "++++++++=++++++++");
$player1->sendMessage(" ");
$player1->sendTip(TextFormat::RED . "You are strarting a duel !");
$player2->sendMessage(" ");
$player2->sendMessage(TextFormat::RED . TextFormat::BOLD . "++++++++=++++++++");
$player2->sendMessage(TextFormat::AQUA . ">" . TextFormat::RESET . " You're starting a duel against : " . $player1->getName() . " !");
$player2->sendMessage(TextFormat::AQUA . ">" . TextFormat::RESET . " You have 3min !");
$player2->sendMessage(TextFormat::AQUA . ">" . TextFormat::RESET . " Good luck :) !");
$player2->sendMessage(TextFormat::RED . TextFormat::BOLD . "++++++++=++++++++");
$player2->sendMessage(" ");
// Launch the end round task
$task = new RoundCheckTask(OneVsOne::getInstance());
$task->arena = $this;
$this->taskHandler = Server::getInstance()->getScheduler()->scheduleDelayedTask($task, self::ROUND_DURATION * 20);
}