/** * @param CommandSender $sender * @param Server $server */ public function sendServerInfo(CommandSender $sender, Server $server) { $sender->sendMessage("Name: " . $server->getServerName()); $sender->sendMessage("Motd: " . $server->getMotd()); $sender->sendMessage("Network-motd: " . $server->getNetwork()->getMotd()); $sender->sendMessage("Address: " . $server->getIp() . ":" . $server->getPort()); $sender->sendMessage("Players: " . count($server->getOnlinePlayers()) . "/" . $server->getMaxPlayers()); $sender->sendMessage("Difficulty: " . $server->getDifficulty()); $sender->sendMessage("Default-gamemode: " . $server->getDefaultGamemode()); $sender->sendMessage("Unique-id: " . $server->getServerUniqueId()); $sender->sendMessage("TPS: " . $server->getTicksPerSecond()); $sender->sendMessage("Average-TPS: " . $server->getTicksPerSecondAverage()); $sender->sendMessage("Codename: " . $server->getCodename()); $sender->sendMessage("API-version: " . $server->getApiVersion()); $sender->sendMessage("MCPE-version: " . $server->getVersion()); $sender->sendMessage("Is-hardcore: " . ($server->isHardcore() ? TextFormat::GREEN . "yes" : TextFormat::RED . "no")); $sender->sendMessage("Is-running: " . ($server->isRunning() ? TextFormat::GREEN . "yes" : TextFormat::RED . "no")); $sender->sendMessage("Is-whitelisted: " . ($server->hasWhitelist() ? TextFormat::GREEN . "yes" : TextFormat::RED . "no")); }
public function setWeatherExecTick($time = 0) { if ($time < 0) { $time = 0; } $tick = $time * $this->server->getTicksPerSecond(); $this->weatherexectick = $tick; return; }
/** * Basic system wide variable definitions * @param Server $server - pocketmine Server * @param array &$vars - variables */ public static function stdSysVars(Server $server, array &$vars) { foreach (["{tps}" => $server->getTicksPerSecond(), "{tickUsage}" => $server->getTickUsage()] as $a => $b) { $vars[$a] = $b; } }