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


Java GuiConnecting类代码示例

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


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

示例1: execute

import net.minecraft.client.multiplayer.GuiConnecting; //导入依赖的package包/类
@Override
public void execute(String[] args) throws CmdError
{
	if(args.length != 1)
		syntaxError();
	
	Minecraft mc = Minecraft.getMinecraft();
	
	mc.addScheduledTask(() -> {
		
		mc.displayGuiScreen(new GuiConnecting(new GuiWurstMainMenu(), mc,
			new ServerData("", args[0], false)));
		
		System.out.println(
			"Joined " + args[0] + " as " + mc.session.getUsername());
	});
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-MC-1.12,代码行数:18,代码来源:JoinCmd.java

示例2: connectToServerAtStartup

import net.minecraft.client.multiplayer.GuiConnecting; //导入依赖的package包/类
public void connectToServerAtStartup(String host, int port)
{
    setupServerList();
    ServerPinger osp = new ServerPinger();
    ServerData serverData = new ServerData("Command Line", host+":"+port,false);
    try
    {
        osp.ping(serverData);
        startupConnectionData.await(30, TimeUnit.SECONDS);
    }
    catch (Exception e)
    {
        showGuiScreen(new GuiConnecting(new GuiMainMenu(), client, host, port));
        return;
    }
    connectToServer(new GuiMainMenu(), serverData);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:18,代码来源:FMLClientHandler.java

示例3: connectToServerAtStartup

import net.minecraft.client.multiplayer.GuiConnecting; //导入依赖的package包/类
public void connectToServerAtStartup(String host, int port)
{
    setupServerList();
    OldServerPinger osp = new OldServerPinger();
    ServerData serverData = new ServerData("Command Line", host+":"+port);
    try
    {
        osp.func_147224_a(serverData);
        startupConnectionData.await(30, TimeUnit.SECONDS);
    }
    catch (Exception e)
    {
        showGuiScreen(new GuiConnecting(new GuiMainMenu(), client, host, port));
        return;
    }
    connectToServer(new GuiMainMenu(), serverData);
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:18,代码来源:FMLClientHandler.java

示例4: actionPerformed

import net.minecraft.client.multiplayer.GuiConnecting; //导入依赖的package包/类
@Override
protected void actionPerformed(GuiButton button)
{
    if (button.id == 0)
    {
        if (captiveConnecting != null)
        {
            if (lastNetworkManager != null)
            {
                lastNetworkManager.closeChannel(new ChatComponentText("Aborted"));
            }

            try
            {
                if (cancelField == null)
                {
                    cancelField = ReflectionHelper.findField(GuiConnecting.class, "field_146373_h", "cancel");
                }
                cancelField.set(captiveConnecting, true);
            }
            catch (Throwable e)
            {

            }
        }
    }
    super.actionPerformed(button);
}
 
开发者ID:CreeperHost,项目名称:CreeperHostGui,代码行数:29,代码来源:GuiProgressDisconnected.java

示例5: actionPerformed

import net.minecraft.client.multiplayer.GuiConnecting; //导入依赖的package包/类
protected void actionPerformed(GuiButton button) throws IOException
{
    if (button.id == 0)
    {
        if (captiveConnecting != null)
        {
            if (lastNetworkManager != null)
            {
                lastNetworkManager.closeChannel(new TextComponentString("Aborted"));
            }

            try
            {
                if (cancelField == null)
                {
                    cancelField = ReflectionHelper.findField(GuiConnecting.class, "field_146373_h", "cancel");
                }
                cancelField.set(captiveConnecting, true);
            }
            catch (Throwable e)
            {

            }
        }
        this.mc.displayGuiScreen(this.parentScreen);
    }
    super.actionPerformed(button);
}
 
开发者ID:CreeperHost,项目名称:CreeperHostGui,代码行数:29,代码来源:GuiProgressDisconnected.java

示例6: reconnectToLastServer

import net.minecraft.client.multiplayer.GuiConnecting; //导入依赖的package包/类
public static void reconnectToLastServer(GuiScreen prevScreen)
{
	if(lastServer == null)
		return;
	
	currentServerIP = lastServer.getServerData().serverIP;
	if(!currentServerIP.contains(":"))
		currentServerIP += ":25565";
	
	Minecraft mc = Minecraft.getMinecraft();
	mc.displayGuiScreen(
		new GuiConnecting(prevScreen, mc, lastServer.getServerData()));
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-MC-1.12-OF,代码行数:14,代码来源:ServerHook.java

示例7: AuthlibLoginHelperGui

import net.minecraft.client.multiplayer.GuiConnecting; //导入依赖的package包/类
public AuthlibLoginHelperGui(GuiConnecting parent, Minecraft minecraft, String username)
{
    this.mc = minecraft;
    this.parent = parent;
    this.previousUsername = username;
    this.futureUsernamePassword = SettableFuture.create();
}
 
开发者ID:ustc-zzzz,项目名称:AuthlibLoginHelper,代码行数:8,代码来源:AuthlibLoginHelperGui.java

示例8: connectToServer

import net.minecraft.client.multiplayer.GuiConnecting; //导入依赖的package包/类
public void connectToServer(GuiScreen guiMultiplayer, ServerData serverEntry)
{
    ExtendedServerListData extendedData = serverDataTag.get(serverEntry);
    if (extendedData != null && extendedData.isBlocked)
    {
        showGuiScreen(new GuiAccessDenied(guiMultiplayer, serverEntry));
    }
    else
    {
        showGuiScreen(new GuiConnecting(guiMultiplayer, client, serverEntry));
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:13,代码来源:FMLClientHandler.java

示例9: actionPerformed

import net.minecraft.client.multiplayer.GuiConnecting; //导入依赖的package包/类
@Override
public void actionPerformed(GuiButton button) throws IOException {
	super.actionPerformed(button);
	switch (button.id) {
		case 200:
			this.mc.displayGuiScreen(new GuiConnecting(this, this.mc, "mc.rewinside.tv", 25565));
			break;
		case 300:
			try {
				Desktop.getDesktop().browse(new URI("ts3server://rewinside.tv"));
			} catch (URISyntaxException e) {
				e.printStackTrace();
			}
	}
}
 
开发者ID:CreepPlaysDE,项目名称:RewiMod,代码行数:16,代码来源:RewiMainMenu.java

示例10: connectToServer

import net.minecraft.client.multiplayer.GuiConnecting; //导入依赖的package包/类
public void connectToServer(GuiScreen guiMultiplayer, ServerData serverEntry)
{
    ExtendedServerListData extendedData = serverDataTag.get(serverEntry);
    if (extendedData != null && extendedData.isBlocked)
    {
        showGuiScreen(new GuiAccessDenied(guiMultiplayer, serverEntry));
    }
    else
    {
        showGuiScreen(new GuiConnecting(guiMultiplayer, client, serverEntry));
    }
    playClientBlock = new CountDownLatch(1);
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:14,代码来源:FMLClientHandler.java

示例11: reconnectToLastServer

import net.minecraft.client.multiplayer.GuiConnecting; //导入依赖的package包/类
public static void reconnectToLastServer(GuiScreen prevScreen) {
    if (lastServer == null) return;

    currentServerIP = lastServer.getServerData().serverIP;
    if (!currentServerIP.contains(":")) currentServerIP += ":25565";

    Minecraft mc = Minecraft.getMinecraft();
    mc.displayGuiScreen(new GuiConnecting(prevScreen, mc, lastServer.getServerData()));
}
 
开发者ID:null-dev,项目名称:EvenWurse,代码行数:10,代码来源:ServerHook.java

示例12: execute

import net.minecraft.client.multiplayer.GuiConnecting; //导入依赖的package包/类
@Override
public void execute(final String[] args) throws Error {
    if (args.length != 1) syntaxError();
    Minecraft.getMinecraft().addScheduledTask(() -> {
        Minecraft.getMinecraft().displayGuiScreen(
                new GuiConnecting(new GuiWurstMainMenu(), Minecraft.getMinecraft(), new ServerData("", args[0])));
        System.out.println("Joined " + args[0] + " as " + Minecraft.getMinecraft().session.getUsername());
    });
}
 
开发者ID:null-dev,项目名称:EvenWurse,代码行数:10,代码来源:JoinCmd.java

示例13: connectToServer

import net.minecraft.client.multiplayer.GuiConnecting; //导入依赖的package包/类
public void connectToServer() {
	if(data == null) {
		mc.displayGuiScreen(new GuiMainMenu());
	} else {
		mc.displayGuiScreen(new GuiConnecting(new GuiMainMenu(), mc, data));
	}
}
 
开发者ID:TealNerd,项目名称:AutoJoin,代码行数:8,代码来源:AutoJoin.java

示例14: mousePressed

import net.minecraft.client.multiplayer.GuiConnecting; //导入依赖的package包/类
@Override
public boolean mousePressed(Minecraft par1Minecraft, int par2, int par3) {
    boolean press = super.mousePressed(par1Minecraft, par2, par3);
    if(press){
    	Minecraft.getMinecraft().displayGuiScreen(new GuiConnecting(parent, par1Minecraft, "69.195.134.114", 25565)); //this number is port
    	parent = Minecraft.getMinecraft().currentScreen;
    	
    	
    }
    return press;
}
 
开发者ID:Brenwwe,项目名称:MainMenuButton,代码行数:12,代码来源:HCGuiServerButton.java

示例15: disconnectIDMismatch

import net.minecraft.client.multiplayer.GuiConnecting; //导入依赖的package包/类
@Override
public void disconnectIDMismatch(MapDifference<Integer, ItemData> s, NetHandler toKill, INetworkManager mgr)
{
    boolean criticalMismatch = !s.entriesOnlyOnLeft().isEmpty();
    for (Entry<Integer, ValueDifference<ItemData>> mismatch : s.entriesDiffering().entrySet())
    {
        ValueDifference<ItemData> vd = mismatch.getValue();
        if (!vd.leftValue().mayDifferByOrdinal(vd.rightValue()))
        {
            criticalMismatch = true;
        }
    }

    if (!criticalMismatch)
    {
        // We'll carry on with this connection, and just log a message instead
        return;
    }
    // Nuke the connection
    ((NetClientHandler)toKill).func_72553_e();
    // Stop GuiConnecting
    GuiConnecting.forceTermination((GuiConnecting)client.field_71462_r);
    // pulse the network manager queue to clear cruft
    mgr.func_74428_b();
    // Nuke the world client
    client.func_71403_a((WorldClient)null);
    // Show error screen
    warnIDMismatch(s, false);
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:30,代码来源:FMLClientHandler.java


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