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


Java GuiDisconnected类代码示例

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


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

示例1: onGuiOpened

import net.minecraft.client.gui.GuiDisconnected; //导入依赖的package包/类
@SubscribeEvent
public void onGuiOpened(GuiOpenEvent event) {
    if (!hasAutoLogged)
    if(event.getGui() instanceof GuiDisconnected &&
            !(event.getGui() instanceof GuiDisconnectedOverride)) {
        updateLastConnectedServer();
        GuiDisconnected disconnected = (GuiDisconnected)event.getGui();
        event.setGui(new GuiDisconnectedOverride(
                FastReflection.Fields.GuiDisconnected_parentScreen.get(disconnected),
                "connect.failed",
                FastReflection.Fields.GuiDisconnected_message.get(disconnected),
                FastReflection.Fields.GuiDisconnected_reason.get(disconnected),
                delay.get()
        ));
    }
}
 
开发者ID:fr1kin,项目名称:ForgeHax,代码行数:17,代码来源:AutoReconnectMod.java

示例2: onDisconnect

import net.minecraft.client.gui.GuiDisconnected; //导入依赖的package包/类
/**
 * Invoked when disconnecting, the parameter is a ChatComponent describing the reason for termination
 */
public void onDisconnect(IChatComponent reason)
{
    this.gameController.loadWorld((WorldClient)null);

    if (this.guiScreenServer != null)
    {
        if (this.guiScreenServer instanceof GuiScreenRealmsProxy)
        {
            this.gameController.displayGuiScreen((new DisconnectedRealmsScreen(((GuiScreenRealmsProxy)this.guiScreenServer).func_154321_a(), "disconnect.lost", reason)).getProxy());
        }
        else
        {
            this.gameController.displayGuiScreen(new GuiDisconnected(this.guiScreenServer, "disconnect.lost", reason));
        }
    }
    else
    {
        this.gameController.displayGuiScreen(new GuiDisconnected(new GuiMultiplayer(new GuiMainMenu()), "disconnect.lost", reason));
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:24,代码来源:NetHandlerPlayClient.java

示例3: onDisconnect

import net.minecraft.client.gui.GuiDisconnected; //导入依赖的package包/类
/**
 * Invoked when disconnecting, the parameter is a ChatComponent describing the
 * reason for termination
 */
public void onDisconnect(IChatComponent reason) {
	this.gameController.loadWorld((WorldClient) null);

	if (this.guiScreenServer != null) {
		if (this.guiScreenServer instanceof GuiScreenRealmsProxy) {
			this.gameController.displayGuiScreen(
					(new DisconnectedRealmsScreen(((GuiScreenRealmsProxy) this.guiScreenServer).func_154321_a(),
							"disconnect.lost", reason)).getProxy());
		} else {
			this.gameController
					.displayGuiScreen(new GuiDisconnected(this.guiScreenServer, "disconnect.lost", reason));
		}
	} else {
		this.gameController.displayGuiScreen(
				new GuiDisconnected(new GuiMultiplayer(new GuiMainMenu()), "disconnect.lost", reason));
	}
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:22,代码来源:NetHandlerPlayClient.java

示例4: onDisconnect

import net.minecraft.client.gui.GuiDisconnected; //导入依赖的package包/类
/**
 * Invoked when disconnecting, the parameter is a ChatComponent describing the reason for termination
 */
public void onDisconnect(ITextComponent reason)
{
    this.gameController.loadWorld((WorldClient)null);

    if (this.guiScreenServer != null)
    {
        if (this.guiScreenServer instanceof GuiScreenRealmsProxy)
        {
            this.gameController.displayGuiScreen((new DisconnectedRealmsScreen(((GuiScreenRealmsProxy)this.guiScreenServer).getProxy(), "disconnect.lost", reason)).getProxy());
        }
        else
        {
            this.gameController.displayGuiScreen(new GuiDisconnected(this.guiScreenServer, "disconnect.lost", reason));
        }
    }
    else
    {
        this.gameController.displayGuiScreen(new GuiDisconnected(new GuiMultiplayer(new GuiMainMenu()), "disconnect.lost", reason));
    }
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:24,代码来源:NetHandlerPlayClient.java

示例5: instanceOf

import net.minecraft.client.gui.GuiDisconnected; //导入依赖的package包/类
public boolean instanceOf(CommonScreenTypes type) {
	if (type.equals(CommonScreenTypes.GuiDisconnected)) {
		return screen instanceof GuiDisconnected;
	} else if (type.equals(CommonScreenTypes.GuiIngameMenu)) {
		return screen instanceof GuiIngameMenu;
	}
	return false;
}
 
开发者ID:Moudoux,项目名称:EMC,代码行数:9,代码来源:EventGuiScreenDraw.java

示例6: onClientTick

import net.minecraft.client.gui.GuiDisconnected; //导入依赖的package包/类
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onClientTick(TickEvent.ClientTickEvent event) {
    Minecraft mc = Minecraft.getMinecraft();
    if (event.phase == TickEvent.Phase.END && mc.theWorld != null && !mc.isSingleplayer()) {
        UUID uuid = mc.thePlayer.getUniqueID();
        timeOnCount.add(uuid);

        if ((maxTimeOn.containsKey(uuid) && timeOnCount.count(uuid) > maxTimeOn.get(uuid)) || (maxTimeOnGlobal != 0 && timeOnCount.count(uuid) > maxTimeOnGlobal)) {
            rejoinTime.put(uuid, System.currentTimeMillis() + (breakTime.containsKey(uuid) ? breakTime.get(uuid) * 50 : breakTimeGlobal * 50));
            timeOnCount.remove(uuid, timeOnCount.count(uuid));
        }

        //Disconnect if still on timeout
        if (rejoinTime.containsKey(uuid) && System.currentTimeMillis() < rejoinTime.get(uuid)) {
            mc.theWorld.sendQuittingDisconnectingPacket();
            mc.loadWorld(null);
            mc.displayGuiScreen(new GuiDisconnected(null, String.format(kickMessage + " You can rejoin in approx. %s minute(s)",
                    (int) Math.floor(((rejoinTime.get(uuid) - System.currentTimeMillis()) / 1000F) / 60F)), new TextComponentString("")));
        }
    }
}
 
开发者ID:kihira,项目名称:BeProductive,代码行数:23,代码来源:BeProductive.java

示例7: onTick

import net.minecraft.client.gui.GuiDisconnected; //导入依赖的package包/类
@SubscribeEvent
public void onTick(ClientTickEvent event) {
	if(mc.currentScreen instanceof GuiDisconnected) {
		GuiDisconnected current = (GuiDisconnected) mc.currentScreen;
		current.drawCenteredString(mc.fontRendererObj, time + " seconds", current.width / 2, 30, Color.WHITE.getRGB());
		if(System.currentTimeMillis() - last >= 1000l) {
			time--;
			last = System.currentTimeMillis();
		}
		if(time == 0) {
			connectToServer();
		}
	}
	if(mc.getCurrentServerData() != null) {
		data = mc.getCurrentServerData();
	}
}
 
开发者ID:TealNerd,项目名称:AutoJoin,代码行数:18,代码来源:AutoJoin.java

示例8: onDisconnect

import net.minecraft.client.gui.GuiDisconnected; //导入依赖的package包/类
public void onDisconnect(IChatComponent p_147231_1_)
{
    this.gameController.loadWorld((WorldClient)null);

    if (this.guiScreenServer != null)
    {
        if (this.guiScreenServer instanceof GuiScreenRealmsProxy)
        {
            this.gameController.displayGuiScreen((new DisconnectedOnlineScreen(((GuiScreenRealmsProxy)this.guiScreenServer).func_154321_a(), "disconnect.lost", p_147231_1_)).getProxy());
        }
        else
        {
            this.gameController.displayGuiScreen(new GuiDisconnected(this.guiScreenServer, "disconnect.lost", p_147231_1_));
        }
    }
    else
    {
        this.gameController.displayGuiScreen(new GuiDisconnected(new GuiMultiplayer(new GuiMainMenu()), "disconnect.lost", p_147231_1_));
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:21,代码来源:NetHandlerPlayClient.java

示例9: handleErrorMessage

import net.minecraft.client.gui.GuiDisconnected; //导入依赖的package包/类
public void handleErrorMessage(String par1Str, Object[] par2ArrayOfObj)
{
    if (!this.disconnected)
    {
        this.disconnected = true;
        this.mc.loadWorld((WorldClient)null);

        if (this.field_98183_l != null)
        {
            this.mc.displayGuiScreen(new GuiScreenDisconnectedOnline(this.field_98183_l, "disconnect.lost", par1Str, par2ArrayOfObj));
        }
        else
        {
            this.mc.displayGuiScreen(new GuiDisconnected(new GuiMultiplayer(new GuiMainMenu()), "disconnect.lost", par1Str, par2ArrayOfObj));
        }
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:18,代码来源:NetClientHandler.java

示例10: GuiDisconnectedOverride

import net.minecraft.client.gui.GuiDisconnected; //导入依赖的package包/类
public GuiDisconnectedOverride(GuiScreen screen, String reasonLocalizationKey, ITextComponent chatComp, String reason, double delay) {
    super(screen, reasonLocalizationKey, chatComp);
    parent = screen;
    message = chatComp;
    reconnectTime = System.currentTimeMillis() + (long)(delay * 1000);
    // set variable 'reason' to the previous classes value
    try {
        ReflectionHelper.setPrivateValue(GuiDisconnected.class, this, reason, "reason", "field_146306_a", "a"); // TODO: Find obbed mapping name
    } catch (Exception e) {
        Helper.printStackTrace(e);
    }
    // parse server return text and find queue pos
}
 
开发者ID:fr1kin,项目名称:ForgeHax,代码行数:14,代码来源:AutoReconnectMod.java

示例11: draw

import net.minecraft.client.gui.GuiDisconnected; //导入依赖的package包/类
@CoreEvent
public void draw(final DrawScreenEvent.Post e) {
	final GuiScreen gui = this.mc.currentScreen;
	if (gui instanceof GuiMultiplayer) {
	} else if (gui instanceof GuiDisconnected) {
		if (this.disableBackButton!=null&&Config.getConfig().durationDisconnected.get()>=10)
			this.disableBackButton.displayString = I18n.format("serverobserver.gui.backandstop.time", I18n.format("serverobserver.gui.backandstop"), timeremain());
	} else if (gui instanceof GuiMainMenu) {
		final GuiButton button = this.mainMenuButtonMulti;
		if (button!=null&&this.target.getIP()!=null&&!this.manualOpen)
			button.displayString = I18n.format("serverobserver.gui.maintomulti.time", I18n.format("menu.multiplayer"), timeremain());
	}
}
 
开发者ID:Team-Fruit,项目名称:ServerObserver,代码行数:14,代码来源:GuiHandler.java

示例12: action

import net.minecraft.client.gui.GuiDisconnected; //导入依赖的package包/类
@CoreEvent
public void action(final ActionPerformedEvent.Post e) {
	this.targetServerStatus = null;
	final GuiScreen screen = this.mc.currentScreen;
	final int id = this.compat.getButton(e).id;
	if (screen instanceof GuiMultiplayer&&id==BUTTON_ID) {
		final GuiMultiplayer mpgui = (GuiMultiplayer) screen;
		final ServerData server = getServerData(mpgui, this.compat.getSelected(mpgui));
		if (server!=null) {
			if (!StringUtils.equals(this.target.getIP(), server.serverIP)) {
				this.autologin.set(false);
				this.target.set(server);
			} else if (!this.autologin.is()) {
				this.autologin.set(true);
				this.target.set(server);
			} else {
				this.autologin.set(false);
				this.target.set(null);
			}
		} else
			selectTarget(mpgui, this.target.getIP());
	} else if (screen instanceof GuiDisconnected&&id==DISABLE_BACK_BUTTON_ID) {
		final GuiDisconnected dcgui = (GuiDisconnected) screen;
		this.autologin.set(false);
		this.target.set(null);
		this.mc.displayGuiScreen(this.compat.getParentScreen(dcgui));
	}
	this.displayTime = "";
	reset(Config.getConfig().durationPing);
	this.manual = false;
}
 
开发者ID:Team-Fruit,项目名称:ServerObserver,代码行数:32,代码来源:GuiHandler.java

示例13: onDisconnect

import net.minecraft.client.gui.GuiDisconnected; //导入依赖的package包/类
/**
 * Invoked when disconnecting, the parameter is a ChatComponent describing the reason for termination
 */
public void onDisconnect(ITextComponent reason)
{
    if (this.previousGuiScreen != null && this.previousGuiScreen instanceof GuiScreenRealmsProxy)
    {
        this.mc.displayGuiScreen((new DisconnectedRealmsScreen(((GuiScreenRealmsProxy)this.previousGuiScreen).getProxy(), "connect.failed", reason)).getProxy());
    }
    else
    {
        this.mc.displayGuiScreen(new GuiDisconnected(this.previousGuiScreen, "connect.failed", reason));
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:15,代码来源:NetHandlerLoginClient.java

示例14: onGuiOpen

import net.minecraft.client.gui.GuiDisconnected; //导入依赖的package包/类
@SubscribeEvent
public void onGuiOpen(GuiOpenEvent event) {
	if(event.getGui() instanceof GuiDisconnected) {
		last = System.currentTimeMillis();
		time = 10;
	}
}
 
开发者ID:TealNerd,项目名称:AutoJoin,代码行数:8,代码来源:AutoJoin.java

示例15: onDisconnect

import net.minecraft.client.gui.GuiDisconnected; //导入依赖的package包/类
/**
 * Invoked when disconnecting, the parameter is a ChatComponent describing the reason for termination
 */
public void onDisconnect(IChatComponent p_147231_1_)
{
	this.gameController.loadWorld((WorldClient)null);

    if (this.guiScreenServer != null)
    {
        this.gameController.displayGuiScreen(new GuiScreenDisconnectedOnline(this.guiScreenServer, "disconnect.lost", p_147231_1_));
    }
    else
    {
        this.gameController.displayGuiScreen(new GuiDisconnected(new GuiMultiplayer(new HookGuiMainMenu()), "disconnect.lost", p_147231_1_));
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:17,代码来源:NetHandlerPlayClient.java


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