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


Java ServerData.copyFrom方法代码示例

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


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

示例1: confirmClicked

import net.minecraft.client.multiplayer.ServerData; //导入方法依赖的package包/类
public void confirmClicked(boolean result, int id)
{
    GuiListExtended.IGuiListEntry guilistextended$iguilistentry = this.serverListSelector.func_148193_k() < 0 ? null : this.serverListSelector.getListEntry(this.serverListSelector.func_148193_k());

    if (this.deletingServer)
    {
        this.deletingServer = false;

        if (result && guilistextended$iguilistentry instanceof ServerListEntryNormal)
        {
            this.savedServerList.removeServerData(this.serverListSelector.func_148193_k());
            this.savedServerList.saveServerList();
            this.serverListSelector.setSelectedSlotIndex(-1);
            this.serverListSelector.func_148195_a(this.savedServerList);
        }

        this.mc.displayGuiScreen(this);
    }
    else if (this.directConnect)
    {
        this.directConnect = false;

        if (result)
        {
            this.connectToServer(this.selectedServer);
        }
        else
        {
            this.mc.displayGuiScreen(this);
        }
    }
    else if (this.addingServer)
    {
        this.addingServer = false;

        if (result)
        {
            this.savedServerList.addServerData(this.selectedServer);
            this.savedServerList.saveServerList();
            this.serverListSelector.setSelectedSlotIndex(-1);
            this.serverListSelector.func_148195_a(this.savedServerList);
        }

        this.mc.displayGuiScreen(this);
    }
    else if (this.editingServer)
    {
        this.editingServer = false;

        if (result && guilistextended$iguilistentry instanceof ServerListEntryNormal)
        {
            ServerData serverdata = ((ServerListEntryNormal)guilistextended$iguilistentry).getServerData();
            serverdata.serverName = this.selectedServer.serverName;
            serverdata.serverIP = this.selectedServer.serverIP;
            serverdata.copyFrom(this.selectedServer);
            this.savedServerList.saveServerList();
            this.serverListSelector.func_148195_a(this.savedServerList);
        }

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

示例2: confirmClicked

import net.minecraft.client.multiplayer.ServerData; //导入方法依赖的package包/类
public void confirmClicked(boolean result, int id)
{
    GuiListExtended.IGuiListEntry guilistextended$iguilistentry = this.serverListSelector.getSelected() < 0 ? null : this.serverListSelector.getListEntry(this.serverListSelector.getSelected());

    if (this.deletingServer)
    {
        this.deletingServer = false;

        if (result && guilistextended$iguilistentry instanceof ServerListEntryNormal)
        {
            this.savedServerList.removeServerData(this.serverListSelector.getSelected());
            this.savedServerList.saveServerList();
            this.serverListSelector.setSelectedSlotIndex(-1);
            this.serverListSelector.updateOnlineServers(this.savedServerList);
        }

        this.mc.displayGuiScreen(this);
    }
    else if (this.directConnect)
    {
        this.directConnect = false;

        if (result)
        {
            this.connectToServer(this.selectedServer);
        }
        else
        {
            this.mc.displayGuiScreen(this);
        }
    }
    else if (this.addingServer)
    {
        this.addingServer = false;

        if (result)
        {
            this.savedServerList.addServerData(this.selectedServer);
            this.savedServerList.saveServerList();
            this.serverListSelector.setSelectedSlotIndex(-1);
            this.serverListSelector.updateOnlineServers(this.savedServerList);
        }

        this.mc.displayGuiScreen(this);
    }
    else if (this.editingServer)
    {
        this.editingServer = false;

        if (result && guilistextended$iguilistentry instanceof ServerListEntryNormal)
        {
            ServerData serverdata = ((ServerListEntryNormal)guilistextended$iguilistentry).getServerData();
            serverdata.serverName = this.selectedServer.serverName;
            serverdata.serverIP = this.selectedServer.serverIP;
            serverdata.copyFrom(this.selectedServer);
            this.savedServerList.saveServerList();
            this.serverListSelector.updateOnlineServers(this.savedServerList);
        }

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


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