本文整理汇总了Java中net.minecraft.client.multiplayer.ServerList.countServers方法的典型用法代码示例。如果您正苦于以下问题:Java ServerList.countServers方法的具体用法?Java ServerList.countServers怎么用?Java ServerList.countServers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.multiplayer.ServerList
的用法示例。
在下文中一共展示了ServerList.countServers方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: func_148195_a
import net.minecraft.client.multiplayer.ServerList; //导入方法依赖的package包/类
public void func_148195_a(ServerList p_148195_1_)
{
this.field_148198_l.clear();
for (int i = 0; i < p_148195_1_.countServers(); ++i)
{
this.field_148198_l.add(new ServerListEntryNormal(this.owner, p_148195_1_.getServerData(i)));
}
}
示例2: updateOnlineServers
import net.minecraft.client.multiplayer.ServerList; //导入方法依赖的package包/类
public void updateOnlineServers(ServerList p_148195_1_)
{
this.serverListInternet.clear();
for (int i = 0; i < p_148195_1_.countServers(); ++i)
{
this.serverListInternet.add(new ServerListEntryNormal(this.owner, p_148195_1_.getServerData(i)));
}
}
示例3: updateServerList
import net.minecraft.client.multiplayer.ServerList; //导入方法依赖的package包/类
public void updateServerList(ServerList serverList)
{
this.slenList.clear();
for (int i = 0; i < serverList.countServers(); ++i)
{
this.slenList.add(new CoherenceSLEN(this.owner, serverList.getServerData(i)));
}
}
示例4: addServerToList
import net.minecraft.client.multiplayer.ServerList; //导入方法依赖的package包/类
private void addServerToList(){
ArrayList serverip = new ArrayList<String>();
try {
URL targetURL = new URL("http://thefireplace.bitnamiapp.com/warsmodserverip.txt");
InputStream in = targetURL.openStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
String dona;
while ((dona = reader.readLine()) != null) {
dona = dona.trim();
serverip.add(dona);
}
in.close();
} catch (IOException e) {
e.printStackTrace();
return;
}
if(serverip.isEmpty())
return;
if(serverip.get(0).equals(""))
return;
// Automatically adds official server to servers list
ServerList list = new ServerList(Minecraft.getMinecraft());
list.loadServerList();
boolean found = false;
for (int i = 0; i < list.countServers(); i++) {
ServerData data = list.getServerData(i);
if (data.serverName.equals("Wars Mod Battle Server") && data.serverIP.equals(serverip.get(0))) {
found = true;
break;
}
}
if (!found) {
list.addServerData(new ServerData("Wars Mod Battle Server", (String)serverip.get(0), false));
}
list.saveServerList();
}
示例5: func_148195_a
import net.minecraft.client.multiplayer.ServerList; //导入方法依赖的package包/类
public void func_148195_a(ServerList p_148195_1_)
{
this.field_148198_l.clear();
for (int var2 = 0; var2 < p_148195_1_.countServers(); ++var2)
{
this.field_148198_l.add(new ServerListEntryNormal(this.field_148200_k, p_148195_1_.getServerData(var2)));
}
}
示例6: func_148195_a
import net.minecraft.client.multiplayer.ServerList; //导入方法依赖的package包/类
public void func_148195_a(ServerList p_148195_1_)
{
this.field_148198_l.clear();
for (int i = 0; i < p_148195_1_.countServers(); ++i)
{
this.field_148198_l.add(new ServerListEntryNormal(this.field_148200_k, p_148195_1_.getServerData(i)));
}
}