本文整理汇总了Java中cn.nukkit.Server.getNukkitVersion方法的典型用法代码示例。如果您正苦于以下问题:Java Server.getNukkitVersion方法的具体用法?Java Server.getNukkitVersion怎么用?Java Server.getNukkitVersion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cn.nukkit.Server
的用法示例。
在下文中一共展示了Server.getNukkitVersion方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: QueryRegenerateEvent
import cn.nukkit.Server; //导入方法依赖的package包/类
public QueryRegenerateEvent(Server server, int timeout) {
this.timeout = timeout;
this.serverName = server.getMotd();
this.listPlugins = (boolean) server.getConfig("settings.query-plugins", true);
this.plugins = server.getPluginManager().getPlugins().values().toArray(new Plugin[server.getPluginManager().getPlugins().values().size()]);
List<Player> players = new ArrayList<>();
for (Player player : server.getOnlinePlayers().values()) {
if (player.isOnline()) {
players.add(player);
}
}
this.players = players.toArray(new Player[players.size()]);
this.gameType = (server.getGamemode() & 0x01) == 0 ? "SMP" : "CMP";
this.version = server.getVersion();
this.server_engine = server.getName() + " " + server.getNukkitVersion();
this.map = server.getDefaultLevel() == null ? "unknown" : server.getDefaultLevel().getName();
this.numPlayers = this.players.length;
this.maxPlayers = server.getMaxPlayers();
this.whitelist = server.hasWhitelist() ? "on" : "off";
this.port = server.getPort();
this.ip = server.getIp();
}
示例2: QueryRegenerateEvent
import cn.nukkit.Server; //导入方法依赖的package包/类
public QueryRegenerateEvent(Server server, int timeout) {
this.timeout = timeout;
this.serverName = server.getMotd();
this.listPlugins = (boolean) server.getConfig("settings.query-plugins", true);
this.plugins = server.getPluginManager().getPlugins().values().toArray(new Plugin[server.getPluginManager().getPlugins().values().size()]);
List<Player> players = new ArrayList<>();
for (Player player : server.getOnlinePlayers().values()) {
if (player.isOnline()) {
players.add(player);
}
}
this.players = players.toArray(new Player[players.size()]);
this.gameType = (server.getDefaultGamemode() & 0x01) == 0 ? "SMP" : "CMP";
this.version = server.getVersion();
this.server_engine = server.getName() + " " + server.getNukkitVersion();
this.map = server.getDefaultLevel() == null ? "unknown" : server.getDefaultLevel().getName();
this.numPlayers = this.players.length;
this.maxPlayers = server.getMaxPlayers();
this.whitelist = server.hasWhitelist() ? "on" : "off";
this.port = server.getPort();
this.ip = server.getIp();
}