public function __construct(Server $server, $timeout = 5)
 {
     $this->timeout = $timeout;
     $this->serverName = $server->getServerName();
     $this->listPlugins = $server->getProperty("settings.query-plugins", true);
     $this->plugins = $server->getPluginManager()->getPlugins();
     $this->players = [];
     foreach ($server->getOnlinePlayers() as $player) {
         if ($player->isOnline()) {
             $this->players[] = $player;
         }
     }
     $this->gametype = ($server->getGamemode() & 0x1) === 0 ? "SMP" : "CMP";
     $this->version = $server->getVersion();
     $this->server_engine = $server->getName() . " " . $server->getBukkitPEVersion();
     $this->map = $server->getDefaultLevel() === null ? "unknown" : $server->getDefaultLevel()->getName();
     $this->numPlayers = count($this->players);
     $this->maxPlayers = $server->getMaxPlayers();
     $this->whitelist = $server->hasWhitelist() ? "on" : "off";
     $this->port = $server->getPort();
     $this->ip = $server->getIp();
 }