protected void func_146284_a(GuiButton p_146284_1_) throws IOException {
   if (p_146284_1_.field_146124_l) {
     if (p_146284_1_.field_146127_k == 1) {
       this.field_146297_k.func_147108_a(this.field_146585_a);
     } else if (p_146284_1_.field_146127_k == 0) {
       ISaveFormat var2 = this.field_146297_k.func_71359_d();
       var2.func_75806_a(this.field_146584_g, this.field_146583_f.func_146179_b().trim());
       this.field_146297_k.func_147108_a(this.field_146585_a);
     }
   }
 }
示例#2
0
 private void func_73972_b(int p_73972_1_, int p_73972_2_) {
   this.field_73887_h.add(
       new GuiButton(
           11, this.field_73880_f / 2 - 100, p_73972_1_, I18n.func_135053_a("menu.playdemo")));
   this.field_73887_h.add(
       this.field_73973_d =
           new GuiButton(
               12,
               this.field_73880_f / 2 - 100,
               p_73972_1_ + p_73972_2_ * 1,
               I18n.func_135053_a("menu.resetdemo")));
   ISaveFormat var3 = this.field_73882_e.func_71359_d();
   WorldInfo var4 = var3.func_75803_c("Demo_World");
   if (var4 == null) {
     this.field_73973_d.field_73742_g = false;
   }
 }
  /** Adds Demo buttons on Main Menu for players who are playing Demo. */
  private void addDemoButtons(int par1, int par2) {
    this.buttonList.add(
        new GuiButton(11, this.width / 2 - 100, par1, I18n.format("menu.playdemo", new Object[0])));
    this.buttonList.add(
        this.buttonResetDemo =
            new GuiButton(
                12,
                this.width / 2 - 100,
                par1 + par2 * 1,
                I18n.format("menu.resetdemo", new Object[0])));
    ISaveFormat isaveformat = this.mc.getSaveLoader();
    WorldInfo worldinfo = isaveformat.getWorldInfo("Demo_World");

    if (worldinfo == null) {
      this.buttonResetDemo.enabled = false;
    }
  }
  /** Adds Demo buttons on Main Menu for players who are playing Demo. */
  private void addDemoButtons(int p_73972_1_, int p_73972_2_) {
    this.buttonList.add(
        new GuiButton(
            11, this.width / 2 - 100, p_73972_1_, I18n.format("menu.playdemo", new Object[0])));
    this.buttonList.add(
        this.buttonResetDemo =
            new GuiButton(
                12,
                this.width / 2 - 100,
                p_73972_1_ + p_73972_2_ * 1,
                I18n.format("menu.resetdemo", new Object[0])));
    ISaveFormat var3 = this.mc.getSaveLoader();
    WorldInfo var4 = var3.getWorldInfo("Demo_World");

    if (var4 == null) {
      this.buttonResetDemo.enabled = false;
    }
  }
  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.minecraftRealmsButton.visible) {
      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_146623_a(this, worldinfo.getWorldName(), 12);
        this.mc.displayGuiScreen(guiyesno);
      }
    }
  }
示例#6
0
  public void confirmClicked(boolean result, int id) {
    if (this.field_146643_x) {
      this.field_146643_x = false;

      if (result) {
        ISaveFormat var3 = this.mc.getSaveLoader();
        var3.flushCache();
        var3.deleteWorldDirectory(this.func_146621_a(id));

        try {
          this.func_146627_h();
        } catch (AnvilConverterException var5) {
          logger.error("Couldn\'t load level list", var5);
        }
      }

      this.mc.displayGuiScreen(this);
    }
  }
  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 == 11) {
      this.mc.launchIntegratedServer("Demo_World", "Demo_World", DemoWorldServer.demoWorldSettings);
    }

    if (p_146284_1_.id == 12) {
      ISaveFormat var2 = this.mc.getSaveLoader();
      WorldInfo var3 = var2.getWorldInfo("Demo_World");

      if (var3 != null) {
        GuiYesNo var4 = GuiSelectWorld.func_152129_a(this, var3.getWorldName(), 12);
        this.mc.displayGuiScreen(var4);
      }
    }
  }
示例#8
0
  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);
      }
    }
  }
  public void confirmClicked(boolean p_73878_1_, int p_73878_2_) {
    if (p_73878_1_ && p_73878_2_ == 12) {
      ISaveFormat var6 = this.mc.getSaveLoader();
      var6.flushCache();
      var6.deleteWorldDirectory("Demo_World");
      this.mc.displayGuiScreen(this);
    } else if (p_73878_2_ == 13) {
      if (p_73878_1_) {
        try {
          Class var3 = Class.forName("java.awt.Desktop");
          Object var4 =
              var3.getMethod("getDesktop", new Class[0]).invoke((Object) null, new Object[0]);
          var3.getMethod("browse", new Class[] {URI.class})
              .invoke(var4, new Object[] {new URI(this.field_104024_v)});
        } catch (Throwable var5) {
          logger.error("Couldn\'t open link", var5);
        }
      }

      this.mc.displayGuiScreen(this);
    }
  }
示例#10
0
  public void func_73878_a(boolean p_73878_1_, int p_73878_2_) {
    if (p_73878_1_ && p_73878_2_ == 12) {
      ISaveFormat var6 = this.field_73882_e.func_71359_d();
      var6.func_75800_d();
      var6.func_75802_e("Demo_World");
      this.field_73882_e.func_71373_a(this);
    } else if (p_73878_2_ == 13) {
      if (p_73878_1_) {
        try {
          Class var3 = Class.forName("java.awt.Desktop");
          Object var4 =
              var3.getMethod("getDesktop", new Class[0]).invoke((Object) null, new Object[0]);
          var3.getMethod("browse", new Class[] {URI.class})
              .invoke(var4, new Object[] {new URI(this.field_104024_v)});
        } catch (Throwable var5) {
          var5.printStackTrace();
        }
      }

      this.field_73882_e.func_71373_a(this);
    }
  }
 public void func_73866_w_() {
   Keyboard.enableRepeatEvents(true);
   this.field_146292_n.clear();
   this.field_146292_n.add(
       new GuiButton(
           0,
           this.field_146294_l / 2 - 100,
           this.field_146295_m / 4 + 96 + 12,
           I18n.func_135052_a("selectWorld.renameButton", new Object[0])));
   this.field_146292_n.add(
       new GuiButton(
           1,
           this.field_146294_l / 2 - 100,
           this.field_146295_m / 4 + 120 + 12,
           I18n.func_135052_a("gui.cancel", new Object[0])));
   ISaveFormat var1 = this.field_146297_k.func_71359_d();
   WorldInfo var2 = var1.func_75803_c(this.field_146584_g);
   String var3 = var2.func_76065_j();
   this.field_146583_f =
       new GuiTextField(2, this.field_146289_q, this.field_146294_l / 2 - 100, 60, 200, 20);
   this.field_146583_f.func_146195_b(true);
   this.field_146583_f.func_146180_a(var3);
 }
  public void confirmClicked(boolean par1, int par2) {
    if (par1 && par2 == 12) {
      ISaveFormat isaveformat = this.mc.getSaveLoader();
      isaveformat.flushCache();
      isaveformat.deleteWorldDirectory("Demo_World");
      this.mc.displayGuiScreen(this);
    } else if (par2 == 13) {
      if (par1) {
        try {
          Class oclass = Class.forName("java.awt.Desktop");
          Object object =
              oclass.getMethod("getDesktop", new Class[0]).invoke((Object) null, new Object[0]);
          oclass
              .getMethod("browse", new Class[] {URI.class})
              .invoke(object, new Object[] {new URI(this.field_104024_v)});
        } catch (Throwable throwable) {
          logger.error("Couldn\'t open link", throwable);
        }
      }

      this.mc.displayGuiScreen(this);
    }
  }
示例#13
0
 private void func_146627_h() throws AnvilConverterException {
   ISaveFormat var1 = this.mc.getSaveLoader();
   this.field_146639_s = var1.getSaveList();
   Collections.sort(this.field_146639_s);
   this.field_146640_r = -1;
 }