@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(); } }
protected void func_77213_a(int p_77213_1_, boolean p_77213_2_) { GuiSelectWorld.func_74072_a(this.field_77254_a, p_77213_1_); boolean var3 = GuiSelectWorld.func_74062_b(this.field_77254_a) >= 0 && GuiSelectWorld.func_74062_b(this.field_77254_a) < this.func_77217_a(); GuiSelectWorld.func_74070_c(this.field_77254_a).field_73742_g = var3; GuiSelectWorld.func_74059_d(this.field_77254_a).field_73742_g = var3; GuiSelectWorld.func_74071_e(this.field_77254_a).field_73742_g = var3; GuiSelectWorld.func_82312_f(this.field_77254_a).field_73742_g = var3; if(p_77213_2_ && var3) { this.field_77254_a.func_74064_e(p_77213_1_); } }
protected void func_77214_a(int p_77214_1_, int p_77214_2_, int p_77214_3_, int p_77214_4_, Tessellator p_77214_5_) { SaveFormatComparator var6 = (SaveFormatComparator)GuiSelectWorld.func_74068_a(this.field_77254_a).get(p_77214_1_); String var7 = var6.func_75788_b(); if(var7 == null || MathHelper.func_76139_a(var7)) { var7 = GuiSelectWorld.func_82313_g(this.field_77254_a) + " " + (p_77214_1_ + 1); } String var8 = var6.func_75786_a(); var8 = var8 + " (" + GuiSelectWorld.func_82315_h(this.field_77254_a).format(new Date(var6.func_75784_e())); var8 = var8 + ")"; String var9 = ""; if(var6.func_75785_d()) { var9 = GuiSelectWorld.func_82311_i(this.field_77254_a) + " " + var9; } else { var9 = GuiSelectWorld.func_82314_j(this.field_77254_a)[var6.func_75790_f().func_77148_a()]; if(var6.func_75789_g()) { var9 = EnumChatFormatting.DARK_RED + I18n.func_135053_a("gameMode.hardcore") + EnumChatFormatting.RESET; } if(var6.func_75783_h()) { var9 = var9 + ", " + I18n.func_135053_a("selectWorld.cheats"); } } this.field_77254_a.func_73731_b(this.field_77254_a.field_73886_k, var7, p_77214_2_ + 2, p_77214_3_ + 1, 16777215); this.field_77254_a.func_73731_b(this.field_77254_a.field_73886_k, var8, p_77214_2_ + 2, p_77214_3_ + 12, 8421504); this.field_77254_a.func_73731_b(this.field_77254_a.field_73886_k, var9, p_77214_2_ + 2, p_77214_3_ + 12 + 10, 8421504); }
protected void func_73875_a(GuiButton p_73875_1_) { if(p_73875_1_.field_73741_f == 0) { this.field_73882_e.func_71373_a(new GuiOptions(this, this.field_73882_e.field_71474_y)); } if(p_73875_1_.field_73741_f == 5) { this.field_73882_e.func_71373_a(new GuiLanguage(this, this.field_73882_e.field_71474_y, this.field_73882_e.func_135016_M())); } if(p_73875_1_.field_73741_f == 1) { this.field_73882_e.func_71373_a(new GuiSelectWorld(this)); } if(p_73875_1_.field_73741_f == 2) { this.field_73882_e.func_71373_a(new GuiMultiplayer(this)); } if(p_73875_1_.field_73741_f == 14 && this.field_130023_H.field_73748_h) { this.func_140005_i(); } if(p_73875_1_.field_73741_f == 4) { this.field_73882_e.func_71400_g(); } if(p_73875_1_.field_73741_f == 11) { this.field_73882_e.func_71371_a("Demo_World", "Demo_World", DemoWorldServer.field_73071_a); } if(p_73875_1_.field_73741_f == 12) { ISaveFormat var2 = this.field_73882_e.func_71359_d(); WorldInfo var3 = var2.func_75803_c("Demo_World"); if(var3 != null) { GuiYesNo var4 = GuiSelectWorld.func_74061_a(this, var3.func_76065_j(), 12); this.field_73882_e.func_71373_a(var4); } } }
@SideOnly(Side.CLIENT) @ForgeSubscribe public void handleGuiOpen(GuiOpenEvent event) { if (event.gui == null) { return; } if (event.gui.getClass().equals(GuiCreateWorld.class)) { GuiScreen parent = ObfuscationReflectionHelper.getPrivateValue(GuiCreateWorld.class, (GuiCreateWorld) event.gui, 0); event.gui = new HackedCreateWorld(parent); } else if (event.gui.getClass().equals(GuiSelectWorld.class)) { for (Field f : GuiSelectWorld.class.getDeclaredFields()) { if (f.getType().isArray()) { try { f.setAccessible(true); String[] strings = Arrays.copyOf((String[]) f.get(event.gui), 4); strings[3] = I18n.getString("gamemode." + Constants.GAMEMODE); f.set(event.gui, strings); return; } catch (Exception e) { e.printStackTrace(); } } } } }
protected void actionPerformed(GuiButton p_146284_1_) { if (p_146284_1_.id == 0) { this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings)); } if (p_146284_1_.id == 5) { this.mc.displayGuiScreen(new GuiLanguage(this, this.mc.gameSettings, this.mc.getLanguageManager())); } if (p_146284_1_.id == 1) { this.mc.displayGuiScreen(new GuiSelectWorld(this)); } if (p_146284_1_.id == 2) { this.mc.displayGuiScreen(new GuiMultiplayer(this)); } if (p_146284_1_.id == 14) { this.func_140005_i(); } if (p_146284_1_.id == 4) { this.mc.shutdown(); } if (p_146284_1_.id == 6) { this.mc.displayGuiScreen(new GuiModList(this)); } if (p_146284_1_.id == 11) { this.mc.launchIntegratedServer("Demo_World", "Demo_World", DemoWorldServer.demoWorldSettings); } if (p_146284_1_.id == 12) { ISaveFormat isaveformat = this.mc.getSaveLoader(); WorldInfo worldinfo = isaveformat.getWorldInfo("Demo_World"); if (worldinfo != null) { GuiYesNo guiyesno = GuiSelectWorld.func_152129_a(this, worldinfo.getWorldName(), 12); this.mc.displayGuiScreen(guiyesno); } } }
protected void actionPerformed(GuiButton button) throws IOException { if (button.id == 0) { this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings)); } if (button.id == 5) { this.mc.displayGuiScreen(new GuiLanguage(this, this.mc.gameSettings, this.mc .getLanguageManager())); } if (button.id == 1) { this.mc.displayGuiScreen(new GuiSelectWorld(this)); } if (button.id == 2) { this.mc.displayGuiScreen(new GuiMultiplayer(this)); } if (button.id == 14 && this.realmsButton.visible) { this.switchToRealms(); } if (button.id == 4) { this.mc.shutdown(); } if (button.id == 6) { this.mc.displayGuiScreen(new net.minecraftforge.fml.client.GuiModList(this)); } if (button.id == 11) { this.mc.launchIntegratedServer("Demo_World", "Demo_World", DemoWorldServer.demoWorldSettings); } if (button.id == 12) { ISaveFormat isaveformat = this.mc.getSaveLoader(); WorldInfo worldinfo = isaveformat.getWorldInfo("Demo_World"); if (worldinfo != null) { GuiYesNo guiyesno = GuiSelectWorld .func_152129_a(this, worldinfo.getWorldName(), 12); this.mc.displayGuiScreen(guiyesno); } } }
public GuiWorldSlot(GuiSelectWorld p_i1053_1_) { super(p_i1053_1_.field_73882_e, p_i1053_1_.field_73880_f, p_i1053_1_.field_73881_g, 32, p_i1053_1_.field_73881_g - 64, 36); this.field_77254_a = p_i1053_1_; }
protected int func_77217_a() { return GuiSelectWorld.func_74068_a(this.field_77254_a).size(); }
protected boolean func_77218_a(int p_77218_1_) { return p_77218_1_ == GuiSelectWorld.func_74062_b(this.field_77254_a); }
protected int func_77212_b() { return GuiSelectWorld.func_74068_a(this.field_77254_a).size() * 36; }