本文整理汇总了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());
});
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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()));
}
示例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();
}
示例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));
}
}
示例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();
}
}
}
示例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);
}
示例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()));
}
示例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());
});
}
示例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));
}
}
示例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;
}
示例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);
}