<?php

namespace Lunarelly\Tasks;

use pocketmine\plugin\PluginBase;
use pocketmine\event\Listener;
use pocketmine\Server;
use pocketmine\Player;
use pocketmine\scheduler\PluginTask;
use Lunarelly\Main;

class AutoRestart extends PluginTask {
	
	public function __construct(Main $main) {
		$this->main = $main;
		parent::__construct($main);
		}
		
		public function onRun($currentTicks) {
			foreach($this->main->getServer()->getOnlinePlayers() as $p) {
				$p->kick("§fServer is restarting!\nVK: §e@dragonflype", false);
				$this->main->getServer()->shutdown();
				}
				}
				}
				?>