当前位置: 首页>>代码示例>>Java>>正文


Java ServerList类代码示例

本文整理汇总了Java中net.minecraft.client.multiplayer.ServerList的典型用法代码示例。如果您正苦于以下问题:Java ServerList类的具体用法?Java ServerList怎么用?Java ServerList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ServerList类属于net.minecraft.client.multiplayer包,在下文中一共展示了ServerList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: func_148195_a

import net.minecraft.client.multiplayer.ServerList; //导入依赖的package包/类
@Override
public void func_148195_a(ServerList serverList)
{
    ourList.clear();

    if (serverList instanceof ServerListPublic)
    {
        ServerListPublic pub = (ServerListPublic) serverList;
        for (int i = 0; i < pub.countServers(); ++i)
        {
            ourList.add(new ServerListEntryPublic(ourParent, new ServerListEntryNormalPubConstructor(ourParent, pub.getServerData(i))));
        }
    }

    sort();
}
 
开发者ID:CreeperHost,项目名称:CreeperHostGui,代码行数:17,代码来源:ServerSelectionListPublic.java

示例2: setServerList

import net.minecraft.client.multiplayer.ServerList; //导入依赖的package包/类
private void setServerList(ServerList serverList)
{
    ourSavedServerList = serverList;
    if (savedServerListField == null)
    {
        savedServerListField = ReflectionHelper.findField(GuiMultiplayer.class, "field_146804_i", "savedServerList");
        savedServerListField.setAccessible(true);
    }

    try
    {
        savedServerListField.set(this, serverList);
    }
    catch (IllegalAccessException e)
    {
        CreeperHost.logger.error("Unable to set server list", e);
    }
}
 
开发者ID:CreeperHost,项目名称:CreeperHostGui,代码行数:19,代码来源:GuiMultiplayerPublic.java

示例3: updateOnlineServers

import net.minecraft.client.multiplayer.ServerList; //导入依赖的package包/类
@Override
public void updateOnlineServers(ServerList serverList)
{
    ourList.clear();

    if (serverList instanceof ServerListPublic)
    {
        ServerListPublic pub = (ServerListPublic) serverList;
        for (int i = 0; i < pub.countServers(); ++i)
        {
            ourList.add(new ServerListEntryPublic(ourParent, new ServerListEntryNormalPubConstructor(ourParent, pub.getServerData(i))));
        }
    }

    sort();
}
 
开发者ID:CreeperHost,项目名称:CreeperHostGui,代码行数:17,代码来源:ServerSelectionListPublic.java

示例4: func_73866_w_

import net.minecraft.client.multiplayer.ServerList; //导入依赖的package包/类
public void func_73866_w_() {
   Keyboard.enableRepeatEvents(true);
   this.field_73887_h.clear();
   if(!this.field_74024_A) {
      this.field_74024_A = true;
      this.field_74030_m = new ServerList(this.field_73882_e);
      this.field_74030_m.func_78853_a();
      this.field_74041_x = new LanServerList();

      try {
         this.field_74040_y = new ThreadLanServerFind(this.field_74041_x);
         this.field_74040_y.start();
      } catch (Exception var2) {
         this.field_73882_e.func_98033_al().func_98236_b("Unable to start LAN server detection: " + var2.getMessage());
      }

      this.field_74022_d = new GuiSlotServer(this);
   } else {
      this.field_74022_d.func_77207_a(this.field_73880_f, this.field_73881_g, 32, this.field_73881_g - 64);
   }

   this.func_74016_g();
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:24,代码来源:GuiMultiplayer.java

示例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 i = 0; i < p_148195_1_.countServers(); ++i)
    {
        this.field_148198_l.add(new ServerListEntryNormal(this.owner, p_148195_1_.getServerData(i)));
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:10,代码来源:ServerSelectionList.java

示例6: initGui

import net.minecraft.client.multiplayer.ServerList; //导入依赖的package包/类
/**
 * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
 * window resizes, the buttonList is cleared beforehand.
 */
public void initGui()
{
    Keyboard.enableRepeatEvents(true);
    this.buttonList.clear();

    if (!this.initialized)
    {
        this.initialized = true;
        this.savedServerList = new ServerList(this.mc);
        this.savedServerList.loadServerList();
        this.lanServerList = new LanServerDetector.LanServerList();

        try
        {
            this.lanServerDetector = new LanServerDetector.ThreadLanServerFind(this.lanServerList);
            this.lanServerDetector.start();
        }
        catch (Exception exception)
        {
            logger.warn("Unable to start LAN server detection: " + exception.getMessage());
        }

        this.serverListSelector = new ServerSelectionList(this, this.mc, this.width, this.height, 32, this.height - 64, 36);
        this.serverListSelector.func_148195_a(this.savedServerList);
    }
    else
    {
        this.serverListSelector.setDimensions(this.width, this.height, 32, this.height - 64);
    }

    this.createButtons();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:37,代码来源:GuiMultiplayer.java

示例7: 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)));
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:10,代码来源:ServerSelectionList.java

示例8: initGui

import net.minecraft.client.multiplayer.ServerList; //导入依赖的package包/类
/**
 * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
 * window resizes, the buttonList is cleared beforehand.
 */
public void initGui()
{
    Keyboard.enableRepeatEvents(true);
    this.buttonList.clear();

    if (this.initialized)
    {
        this.serverListSelector.setDimensions(this.width, this.height, 32, this.height - 64);
    }
    else
    {
        this.initialized = true;
        this.savedServerList = new ServerList(this.mc);
        this.savedServerList.loadServerList();
        this.lanServerList = new LanServerDetector.LanServerList();

        try
        {
            this.lanServerDetector = new LanServerDetector.ThreadLanServerFind(this.lanServerList);
            this.lanServerDetector.start();
        }
        catch (Exception exception)
        {
            LOGGER.warn("Unable to start LAN server detection: {}", new Object[] {exception.getMessage()});
        }

        this.serverListSelector = new ServerSelectionList(this, this.mc, this.width, this.height, 32, this.height - 64, 36);
        this.serverListSelector.updateOnlineServers(this.savedServerList);
    }

    this.createButtons();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:37,代码来源:GuiMultiplayer.java

示例9: 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)));
    }
}
 
开发者ID:tasgoon,项目名称:Coherence,代码行数:10,代码来源:CoherenceSSL.java

示例10: initGui

import net.minecraft.client.multiplayer.ServerList; //导入依赖的package包/类
/**
 * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
 * window resizes, the buttonList is cleared beforehand.
 */
public void initGui()
{
    Keyboard.enableRepeatEvents(true);
    this.buttonList.clear();

    if (!this.initialized)
    {
        this.initialized = true;
        this.savedServerList = new ServerList(this.mc);
        this.savedServerList.loadServerList();
        this.lanServerList = new LanServerDetector.LanServerList();

        try
        {
            this.lanServerDetector = new LanServerDetector.ThreadLanServerFind(this.lanServerList);
            this.lanServerDetector.start();
        }
        catch (Exception exception)
        {
            logger.warn("Unable to start LAN server detection: " + exception.getMessage());
        }

        this.serverListSelector = new CoherenceSSL(this, this.mc, this.width, this.height, 32, this.height - 64, 36);
        this.serverListSelector.updateServerList(this.savedServerList);
    }
    else
    {
        this.serverListSelector.setDimensions(this.width, this.height, 32, this.height - 64);
    }

    this.createButtons();
}
 
开发者ID:tasgoon,项目名称:Coherence,代码行数:37,代码来源:UiMultiplayer.java

示例11: 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();
}
 
开发者ID:The-Fireplace-Minecraft-Mods,项目名称:Wars-Mod,代码行数:37,代码来源:ClientProxy.java

示例12: 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)));
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:10,代码来源:ServerSelectionList.java

示例13: initGui

import net.minecraft.client.multiplayer.ServerList; //导入依赖的package包/类
/**
 * Adds the buttons (and other controls) to the screen in question.
 */
public void initGui()
{
    Keyboard.enableRepeatEvents(true);
    this.buttonList.clear();

    if (!this.field_146801_C)
    {
        this.field_146801_C = true;
        this.field_146804_i = new ServerList(this.mc);
        this.field_146804_i.loadServerList();
        this.field_146799_A = new LanServerDetector.LanServerList();

        try
        {
            this.field_146800_B = new LanServerDetector.ThreadLanServerFind(this.field_146799_A);
            this.field_146800_B.start();
        }
        catch (Exception var2)
        {
            logger.warn("Unable to start LAN server detection: " + var2.getMessage());
        }

        this.field_146803_h = new ServerSelectionList(this, this.mc, this.width, this.height, 32, this.height - 64, 36);
        this.field_146803_h.func_148195_a(this.field_146804_i);
    }
    else
    {
        this.field_146803_h.func_148122_a(this.width, this.height, 32, this.height - 64);
    }

    this.func_146794_g();
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:36,代码来源:GuiMultiplayer.java

示例14: 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)));
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:10,代码来源:ServerSelectionList.java

示例15: initGui

import net.minecraft.client.multiplayer.ServerList; //导入依赖的package包/类
public void initGui()
{
    Keyboard.enableRepeatEvents(true);
    this.buttonList.clear();

    if (!this.field_146801_C)
    {
        this.field_146801_C = true;
        this.field_146804_i = new ServerList(this.mc);
        this.field_146804_i.loadServerList();
        this.field_146799_A = new LanServerDetector.LanServerList();

        try
        {
            this.field_146800_B = new LanServerDetector.ThreadLanServerFind(this.field_146799_A);
            this.field_146800_B.start();
        }
        catch (Exception exception)
        {
            logger.warn("Unable to start LAN server detection: " + exception.getMessage());
        }

        this.field_146803_h = new ServerSelectionList(this, this.mc, this.width, this.height, 32, this.height - 64, 36);
        this.field_146803_h.func_148195_a(this.field_146804_i);
    }
    else
    {
        this.field_146803_h.func_148122_a(this.width, this.height, 32, this.height - 64);
    }

    this.func_146794_g();
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:33,代码来源:GuiMultiplayer.java


注:本文中的net.minecraft.client.multiplayer.ServerList类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。