Пример #1
0
  protected void func_73875_a(GuiButton p_73875_1_) {
    if (p_73875_1_.field_73742_g) {
      if (p_73875_1_.field_73741_f == 5) {
        if (Minecraft.func_71376_c() == EnumOS.MACOS) {
          try {
            this.field_73882_e.func_98033_al().func_98233_a(this.field_73966_c);
            Runtime.getRuntime().exec(new String[] {"/usr/bin/open", this.field_73966_c});
            return;
          } catch (IOException var7) {
            var7.printStackTrace();
          }
        } else if (Minecraft.func_71376_c() == EnumOS.WINDOWS) {
          String var2 =
              String.format(
                  "cmd.exe /C start \"Open file\" \"%s\"", new Object[] {this.field_73966_c});

          try {
            Runtime.getRuntime().exec(var2);
            return;
          } catch (IOException var6) {
            var6.printStackTrace();
          }
        }

        boolean var8 = false;

        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 File(Minecraft.func_71380_b(), "texturepacks")).toURI()});
        } catch (Throwable var5) {
          var5.printStackTrace();
          var8 = true;
        }

        if (var8) {
          this.field_73882_e.func_98033_al().func_98233_a("Opening via system class!");
          Sys.openURL("file://" + this.field_73966_c);
        }
      } else if (p_73875_1_.field_73741_f == 6) {
        this.field_73882_e.func_71373_a(this.field_73967_a);
      } else {
        this.field_73964_d.func_77219_a(p_73875_1_);
      }
    }
  }
Пример #2
0
 public void func_73866_w_() {
   StringTranslate var1 = StringTranslate.func_74808_a();
   this.field_73887_h.add(
       new GuiSmallButton(
           5,
           this.field_73880_f / 2 - 154,
           this.field_73881_g - 48,
           var1.func_74805_b("texturePack.openFolder")));
   this.field_73887_h.add(
       new GuiSmallButton(
           6, this.field_73880_f / 2 + 4, this.field_73881_g - 48, var1.func_74805_b("gui.done")));
   this.field_73882_e.field_71418_C.func_77305_c();
   this.field_73966_c = (new File(Minecraft.func_71380_b(), "texturepacks")).getAbsolutePath();
   this.field_73964_d = new GuiTexturePackSlot(this);
   this.field_73964_d.func_77220_a(this.field_73887_h, 7, 8);
 }
  public IntegratedServer(
      Minecraft p_i3118_1_, String p_i3118_2_, String p_i3118_3_, WorldSettings p_i3118_4_) {
    super(new File(Minecraft.func_71380_b(), "saves"));
    this.func_71224_l(p_i3118_1_.field_71449_j.field_74286_b);
    this.func_71261_m(p_i3118_2_);
    this.func_71246_n(p_i3118_3_);
    this.func_71204_b(p_i3118_1_.func_71355_q());
    this.func_71194_c(p_i3118_4_.func_77167_c());
    this.func_71191_d(256);
    this.func_71210_a(new IntegratedPlayerList(this));
    this.field_71349_l = p_i3118_1_;
    this.field_71350_m = p_i3118_4_;
    ModLoader.registerServer(this);

    try {
      this.field_71347_n = new IntegratedServerListenThread(this);
    } catch (IOException var6) {
      throw new Error();
    }
  }
public class IntegratedServer extends MinecraftServer {

  private final Minecraft field_71349_l;
  private final WorldSettings field_71350_m;
  private final ILogAgent field_98130_m =
      new LogAgent(
          "Minecraft-Server",
          " [SERVER]",
          (new File(Minecraft.func_71380_b(), "output-server.log")).getAbsolutePath());
  private IntegratedServerListenThread field_71347_n;
  private boolean field_71348_o = false;
  private boolean field_71346_p;
  private ThreadLanServerPing field_71345_q;

  public IntegratedServer(
      Minecraft p_i3118_1_, String p_i3118_2_, String p_i3118_3_, WorldSettings p_i3118_4_) {
    super(new File(Minecraft.func_71380_b(), "saves"));
    this.func_71224_l(p_i3118_1_.field_71449_j.field_74286_b);
    this.func_71261_m(p_i3118_2_);
    this.func_71246_n(p_i3118_3_);
    this.func_71204_b(p_i3118_1_.func_71355_q());
    this.func_71194_c(p_i3118_4_.func_77167_c());
    this.func_71191_d(256);
    this.func_71210_a(new IntegratedPlayerList(this));
    this.field_71349_l = p_i3118_1_;
    this.field_71350_m = p_i3118_4_;
    ModLoader.registerServer(this);

    try {
      this.field_71347_n = new IntegratedServerListenThread(this);
    } catch (IOException var6) {
      throw new Error();
    }
  }

  protected void func_71247_a(
      String p_71247_1_,
      String p_71247_2_,
      long p_71247_3_,
      WorldType p_71247_5_,
      String p_71247_6_) {
    this.func_71237_c(p_71247_1_);
    this.field_71305_c = new WorldServer[3];
    this.field_71312_k = new long[this.field_71305_c.length][100];
    ISaveHandler var7 = this.func_71254_M().func_75804_a(p_71247_1_, true);

    for (int var8 = 0; var8 < this.field_71305_c.length; ++var8) {
      byte var9 = 0;
      if (var8 == 1) {
        var9 = -1;
      }

      if (var8 == 2) {
        var9 = 1;
      }

      if (var8 == 0) {
        if (this.func_71242_L()) {
          this.field_71305_c[var8] =
              new DemoWorldServer(
                  this, var7, p_71247_2_, var9, this.field_71304_b, this.func_98033_al());
        } else {
          this.field_71305_c[var8] =
              new WorldServer(
                  this,
                  var7,
                  p_71247_2_,
                  var9,
                  this.field_71350_m,
                  this.field_71304_b,
                  this.func_98033_al());
        }
      } else {
        this.field_71305_c[var8] =
            new WorldServerMulti(
                this,
                var7,
                p_71247_2_,
                var9,
                this.field_71350_m,
                this.field_71305_c[0],
                this.field_71304_b,
                this.func_98033_al());
      }

      this.field_71305_c[var8].func_72954_a(new WorldManager(this, this.field_71305_c[var8]));
      this.func_71203_ab().func_72364_a(this.field_71305_c);
    }

    this.func_71226_c(this.func_71232_g());
    this.func_71222_d();
  }

  protected boolean func_71197_b() throws IOException {
    this.field_98130_m.func_98233_a("Starting integrated minecraft server version 1.5.2");
    this.func_71229_d(false);
    this.func_71251_e(true);
    this.func_71257_f(true);
    this.func_71188_g(true);
    this.func_71245_h(true);
    this.field_98130_m.func_98233_a("Generating keypair");
    this.func_71253_a(CryptManager.func_75891_b());
    this.func_71247_a(
        this.func_71270_I(),
        this.func_71221_J(),
        this.field_71350_m.func_77160_d(),
        this.field_71350_m.func_77165_h(),
        this.field_71350_m.func_82749_j());
    this.func_71205_p(
        this.func_71214_G() + " - " + this.field_71305_c[0].func_72912_H().func_76065_j());
    return true;
  }

  public void func_71217_p() {
    boolean var1 = this.field_71348_o;
    this.field_71348_o = this.field_71347_n.func_71752_f();
    if (!var1 && this.field_71348_o) {
      this.field_98130_m.func_98233_a("Saving and pausing game...");
      this.func_71203_ab().func_72389_g();
      this.func_71267_a(false);
    }

    if (!this.field_71348_o) {
      super.func_71217_p();
    }
  }

  public boolean func_71225_e() {
    return false;
  }

  public EnumGameType func_71265_f() {
    return this.field_71350_m.func_77162_e();
  }

  public int func_71232_g() {
    return this.field_71349_l.field_71474_y.field_74318_M;
  }

  public boolean func_71199_h() {
    return this.field_71350_m.func_77158_f();
  }

  protected File func_71238_n() {
    return this.field_71349_l.field_71412_D;
  }

  public boolean func_71262_S() {
    return false;
  }

  public IntegratedServerListenThread func_71343_a() {
    return this.field_71347_n;
  }

  protected void func_71228_a(CrashReport p_71228_1_) {
    this.field_71349_l.func_71404_a(p_71228_1_);
  }

  public CrashReport func_71230_b(CrashReport p_71230_1_) {
    p_71230_1_ = super.func_71230_b(p_71230_1_);
    p_71230_1_.func_85056_g().func_71500_a("Type", new CallableType3(this));
    p_71230_1_.func_85056_g().func_71500_a("Is Modded", new CallableIsModded(this));
    return p_71230_1_;
  }

  public void func_70000_a(PlayerUsageSnooper p_70000_1_) {
    super.func_70000_a(p_70000_1_);
    p_70000_1_.func_76472_a("snooper_partner", this.field_71349_l.func_71378_E().func_80006_f());
  }

  public boolean func_70002_Q() {
    return Minecraft.func_71410_x().func_70002_Q();
  }

  public String func_71206_a(EnumGameType p_71206_1_, boolean p_71206_2_) {
    try {
      String var3 = this.field_71347_n.func_71755_c();
      this.func_98033_al().func_98233_a("Started on " + var3);
      this.field_71346_p = true;
      this.field_71345_q = new ThreadLanServerPing(this.func_71273_Y(), var3);
      this.field_71345_q.start();
      this.func_71203_ab().func_72357_a(p_71206_1_);
      this.func_71203_ab().func_72387_b(p_71206_2_);
      return var3;
    } catch (IOException var4) {
      return null;
    }
  }

  public ILogAgent func_98033_al() {
    return this.field_98130_m;
  }

  public void func_71260_j() {
    super.func_71260_j();
    if (this.field_71345_q != null) {
      this.field_71345_q.interrupt();
      this.field_71345_q = null;
    }
  }

  public void func_71263_m() {
    super.func_71263_m();
    if (this.field_71345_q != null) {
      this.field_71345_q.interrupt();
      this.field_71345_q = null;
    }
  }

  public boolean func_71344_c() {
    return this.field_71346_p;
  }

  public void func_71235_a(EnumGameType p_71235_1_) {
    this.func_71203_ab().func_72357_a(p_71235_1_);
  }

  public boolean func_82356_Z() {
    return true;
  }

  public NetworkListenThread func_71212_ac() {
    return this.func_71343_a();
  }
}
  public PanelCrashReport(CrashReport p_i3010_1_) {
    this.setBackground(new Color(3028036));
    this.setLayout(new BorderLayout());
    StringWriter var2 = new StringWriter();
    p_i3010_1_.func_71505_b().printStackTrace(new PrintWriter(var2));
    String var3 = var2.toString();
    String var4 = "";
    String var5 = "";

    try {
      var5 = var5 + "Generated " + (new SimpleDateFormat()).format(new Date()) + "\n";
      var5 = var5 + "\n";
      var5 = var5 + p_i3010_1_.func_90021_c();
      var4 = GL11.glGetString(7936);
    } catch (Throwable var9) {
      var5 = var5 + "[failed to get system properties (" + var9 + ")]\n";
    }

    var5 = var5 + "\n\n";
    var5 = var5 + var3;
    String var6 = "";
    var6 = var6 + "\n";
    var6 = var6 + "\n";
    if (var3.contains("Pixel format not accelerated")) {
      var6 = var6 + "      Bad video card drivers!      \n";
      var6 = var6 + "      -----------------------      \n";
      var6 = var6 + "\n";
      var6 =
          var6
              + "Minecraft was unable to start because it failed to find an accelerated OpenGL mode.\n";
      var6 = var6 + "This can usually be fixed by updating the video card drivers.\n";
      if (var4.toLowerCase().contains("nvidia")) {
        var6 = var6 + "\n";
        var6 = var6 + "You might be able to find drivers for your video card here:\n";
        var6 = var6 + "  http://www.nvidia.com/\n";
      } else if (var4.toLowerCase().contains("ati")) {
        var6 = var6 + "\n";
        var6 = var6 + "You might be able to find drivers for your video card here:\n";
        var6 = var6 + "  http://www.amd.com/\n";
      }
    } else {
      var6 = var6 + "      Minecraft has crashed!      \n";
      var6 = var6 + "      ----------------------      \n";
      var6 = var6 + "\n";
      var6 =
          var6
              + "Minecraft has stopped running because it encountered a problem; "
              + p_i3010_1_.func_71501_a()
              + "\n\n";
      File var7 = p_i3010_1_.func_71497_f();
      if (var7 == null) {
        p_i3010_1_.func_71508_a(
            new File(
                new File(Minecraft.func_71380_b(), "crash-reports"),
                "crash-"
                    + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date())
                    + "-client.txt"),
            Minecraft.func_71410_x().func_98033_al());
        var7 = p_i3010_1_.func_71497_f();
      }

      if (var7 != null) {
        String var8 = var7.getAbsolutePath();
        var6 =
            var6
                + "A full error report has been saved to "
                + var8
                + " - Please include a copy of that file (Not this screen!) if you report this crash to anyone; without it, they will not be able to help fix the crash :(";
        var5 =
            "Full report at:\n"
                + var8
                + "\nPlease show that file to Mojang, NOT just this screen!\n\n"
                + var5;
      } else {
        var6 = var6 + "We were unable to save this report to a file.";
      }

      var6 = var6 + "\n";
    }

    var6 = var6 + "\n";
    var6 = var6 + "\n";
    var6 = var6 + "\n";
    var6 = var6 + "--- BEGIN ERROR REPORT " + Integer.toHexString(var6.hashCode()) + " --------\n";
    var6 = var6 + var5;
    var6 = var6 + "--- END ERROR REPORT " + Integer.toHexString(var6.hashCode()) + " ----------\n";
    var6 = var6 + "\n";
    var6 = var6 + "\n";
    TextArea var10 = new TextArea(var6, 0, 0, 1);
    var10.setFont(new Font("Monospaced", 0, 12));
    this.add(new CanvasMojangLogo(), "North");
    this.add(new CanvasCrashReport(80), "East");
    this.add(new CanvasCrashReport(80), "West");
    this.add(new CanvasCrashReport(100), "South");
    this.add(var10, "Center");
  }