本文整理汇总了Java中net.minecraft.client.gui.GuiMultiplayer类的典型用法代码示例。如果您正苦于以下问题:Java GuiMultiplayer类的具体用法?Java GuiMultiplayer怎么用?Java GuiMultiplayer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GuiMultiplayer类属于net.minecraft.client.gui包,在下文中一共展示了GuiMultiplayer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onDisconnect
import net.minecraft.client.gui.GuiMultiplayer; //导入依赖的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));
}
}
示例2: run
import net.minecraft.client.gui.GuiMultiplayer; //导入依赖的package包/类
@Override
public void run() {
while (true) {
if (NetworkUtils.this.mc.getCurrentServerData() != null) {
try {
if (NetworkUtils.this.mc.currentScreen == null || !(NetworkUtils.this.mc.currentScreen instanceof GuiMultiplayer)) {
NetworkUtils.this.pinger.ping(NetworkUtils.this.mc.getCurrentServerData());
}
}
catch (UnknownHostException ex) {}
}
try {
Thread.sleep(1000L);
}
catch (InterruptedException e) {
e.printStackTrace();
}
}
}
示例3: onDisconnect
import net.minecraft.client.gui.GuiMultiplayer; //导入依赖的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));
}
}
示例4: onDisconnect
import net.minecraft.client.gui.GuiMultiplayer; //导入依赖的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));
}
}
示例5: onUpdate
import net.minecraft.client.gui.GuiMultiplayer; //导入依赖的package包/类
@Override
public void onUpdate() {
if(mc.thePlayer.getHealth() <= leaveHealth){
boolean flag = this.mc.isIntegratedServerRunning();
boolean flag1 = this.mc.isConnectedToRealms();
this.mc.theWorld.sendQuittingDisconnectingPacket();
this.mc.loadWorld((WorldClient)null);
if (flag)
{
this.mc.displayGuiScreen(new CheataMainMenu());
}
else if (flag1)
{
RealmsBridge realmsbridge = new RealmsBridge();
realmsbridge.switchToRealms(new CheataMainMenu());
}
else
{
this.mc.displayGuiScreen(new GuiMultiplayer(new CheataMainMenu()));
}
}
}
示例6: tickStart
import net.minecraft.client.gui.GuiMultiplayer; //导入依赖的package包/类
@Override
public void tickStart(EnumSet<TickType> type, Object... tickData) {
if(type.contains(TickType.RENDER)){
if(Minecraft.getMinecraft().currentScreen != null &&
Minecraft.getMinecraft().currentScreen instanceof GuiMultiplayer){
lastScreen = Minecraft.getMinecraft().currentScreen;
int x = lastScreen.width / 1 - 210;
int y = lastScreen.height / 4 - 65;
List buttonList = getButtonList(lastScreen);
boolean hasMumButton = false;
for(Object o : buttonList){
if(o instanceof HCGuiServerButton){
hasMumButton = true;
break;
}
}
if(!hasMumButton){
buttonList.add(new HCGuiServerButton(99, x, y, lastScreen));
}
}
}
}
示例7: onDisconnect
import net.minecraft.client.gui.GuiMultiplayer; //导入依赖的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_));
}
}
示例8: func_77213_a
import net.minecraft.client.gui.GuiMultiplayer; //导入依赖的package包/类
protected void func_77213_a(int p_77213_1_, boolean p_77213_2_) {
if(p_77213_1_ < GuiMultiplayer.func_74006_a(this.field_77250_a).func_78856_c() + GuiMultiplayer.func_74003_b(this.field_77250_a).size()) {
int var3 = GuiMultiplayer.func_74020_c(this.field_77250_a);
GuiMultiplayer.func_74015_a(this.field_77250_a, p_77213_1_);
ServerData var4 = GuiMultiplayer.func_74006_a(this.field_77250_a).func_78856_c() > p_77213_1_?GuiMultiplayer.func_74006_a(this.field_77250_a).func_78850_a(p_77213_1_):null;
boolean var5 = GuiMultiplayer.func_74020_c(this.field_77250_a) >= 0 && GuiMultiplayer.func_74020_c(this.field_77250_a) < this.func_77217_a() && (var4 == null || var4.field_82821_f == 78);
boolean var6 = GuiMultiplayer.func_74020_c(this.field_77250_a) < GuiMultiplayer.func_74006_a(this.field_77250_a).func_78856_c();
GuiMultiplayer.func_74014_d(this.field_77250_a).field_73742_g = var5;
GuiMultiplayer.func_74005_e(this.field_77250_a).field_73742_g = var6;
GuiMultiplayer.func_74019_f(this.field_77250_a).field_73742_g = var6;
if(p_77213_2_ && var5) {
GuiMultiplayer.func_74008_b(this.field_77250_a, p_77213_1_);
} else if(var6 && GuiScreen.func_73877_p() && var3 >= 0 && var3 < GuiMultiplayer.func_74006_a(this.field_77250_a).func_78856_c()) {
GuiMultiplayer.func_74006_a(this.field_77250_a).func_78857_a(var3, GuiMultiplayer.func_74020_c(this.field_77250_a));
}
}
}
示例9: func_77249_c
import net.minecraft.client.gui.GuiMultiplayer; //导入依赖的package包/类
private void func_77249_c(int p_77249_1_, int p_77249_2_, int p_77249_3_, int p_77249_4_, Tessellator p_77249_5_) {
this.field_77250_a.func_73732_a(this.field_77250_a.field_73886_k, I18n.func_135053_a("lanServer.scanning"), this.field_77250_a.field_73880_f / 2, p_77249_3_ + 1, 16777215);
String var6;
switch(GuiMultiplayer.func_74010_g(this.field_77250_a) / 3 % 4) {
case 0:
default:
var6 = "O o o";
break;
case 1:
case 3:
var6 = "o O o";
break;
case 2:
var6 = "o o O";
}
this.field_77250_a.func_73732_a(this.field_77250_a.field_73886_k, var6, this.field_77250_a.field_73880_f / 2, p_77249_3_ + 12, 8421504);
}
示例10: handleErrorMessage
import net.minecraft.client.gui.GuiMultiplayer; //导入依赖的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));
}
}
}
示例11: actionPerformed
import net.minecraft.client.gui.GuiMultiplayer; //导入依赖的package包/类
@Override
protected void actionPerformed(GuiButton button) {
switch (button.id) {
case 1: // Singleplayer
RenderUtil.MINECRAFT.displayGuiScreen(new GuiSelectWorld(this));
break;
case 2: // Multiplayer
RenderUtil.MINECRAFT.displayGuiScreen(new GuiMultiplayer(this));
break;
case 3: // Options
RenderUtil.MINECRAFT.displayGuiScreen(new GuiOptions(this, RenderUtil.MINECRAFT.gameSettings));
break;
case 4: // Mods
RenderUtil.MINECRAFT.displayGuiScreen(new GuiModList(this));
break;
case 5: // Addons
break;
case 6: // Quit
RenderUtil.MINECRAFT.shutdown();
}
}
示例12: CreeperHostEntry
import net.minecraft.client.gui.GuiMultiplayer; //导入依赖的package包/类
protected CreeperHostEntry(GuiMultiplayer p_i45048_1_, ServerData serverIn)
{
super(p_i45048_1_, serverIn);
serverIcon = Config.getInstance().isServerHostMenuImage() ? CreeperHost.instance.getImplementation().getMenuIcon() : new ResourceLocation("creeperhost", "textures/nobrandmp.png");
cross = new String(Character.toChars(10006));
stringWidth = this.mc.fontRenderer.getStringWidth(cross);
}
示例13: mousePressed
import net.minecraft.client.gui.GuiMultiplayer; //导入依赖的package包/类
/**
* Called when the mouse is clicked within this entry. Returning true means that something within this entry was
* clicked and the list should not be dragged.
*/
public boolean mousePressed(int slotIndex, int mouseX, int mouseY, int mouseEvent, int x, int y)
{
if (x >= 303 - stringWidth - 2 && x <= 303 - 3 && y >= 0 && y <= 7)
{
Config.getInstance().setMpMenuEnabled(false);
CreeperHost.instance.saveConfig();
this.mc.displayGuiScreen(new GuiMultiplayer(null));
return true;
}
Minecraft.getMinecraft().displayGuiScreen(GuiGetServer.getByStep(0, new Order()));
return true;
}
示例14: actionPerformed
import net.minecraft.client.gui.GuiMultiplayer; //导入依赖的package包/类
@Override
protected void actionPerformed(GuiButton button)
{
if (button == this.buttonPrev)
{
this.mc.displayGuiScreen(getByStep(this.stepId - 1, this.order));
}
else if (button == this.buttonNext)
{
if (this.stepId + 1 == STEP_AMOUNT)
{
this.mc.displayGuiScreen(new GuiMultiplayer(null));
}
else
{
this.mc.displayGuiScreen(getByStep(this.stepId + 1, this.order));
}
}
else if (button == this.buttonCancel)
{
this.mc.displayGuiScreen(null);
}
else
{
super.actionPerformed(button);
}
}
示例15: CreeperHostEntry
import net.minecraft.client.gui.GuiMultiplayer; //导入依赖的package包/类
protected CreeperHostEntry(GuiMultiplayer p_i45048_1_, ServerData serverIn)
{
super(p_i45048_1_, serverIn);
ourMP = p_i45048_1_;
serverIcon = Config.getInstance().isServerHostMenuImage() ? CreeperHost.instance.getImplementation().getMenuIcon() : new ResourceLocation("creeperhost", "textures/nobrandmp.png");
cross = new String(Character.toChars(10006));
stringWidth = this.mc.fontRendererObj.getStringWidth(cross);
}