Exemplo n.º 1
0
  public void addInfoToCrashReport(CrashReportCategory reportCategory) {
    reportCategory.addCrashSectionCallable(
        "Name",
        new Callable() {
          private static final String __OBFID = "CL_00000341";

          public String call() {
            return (String) TileEntity.classToNameMap.get(TileEntity.this.getClass())
                + " // "
                + TileEntity.this.getClass().getCanonicalName();
          }
        });
    if (this.worldObj != null) {
      CrashReportCategory.addBlockInfo(
          reportCategory, this.pos, this.getBlockType(), this.getBlockMetadata());
      reportCategory.addCrashSectionCallable(
          "Actual block type",
          new Callable() {
            private static final String __OBFID = "CL_00000343";

            public String call() {
              int var1 =
                  Block.getIdFromBlock(
                      TileEntity.this.worldObj.getBlockState(TileEntity.this.pos).getBlock());

              try {
                return String.format(
                    "ID #%d (%s // %s)",
                    new Object[] {
                      Integer.valueOf(var1),
                      Block.getBlockById(var1).getUnlocalizedName(),
                      Block.getBlockById(var1).getClass().getCanonicalName()
                    });
              } catch (Throwable var3) {
                return "ID #" + var1;
              }
            }
          });
      reportCategory.addCrashSectionCallable(
          "Actual block data value",
          new Callable() {
            private static final String __OBFID = "CL_00000344";

            public String call() {
              IBlockState var1 = TileEntity.this.worldObj.getBlockState(TileEntity.this.pos);
              int var2 = var1.getBlock().getMetaFromState(var1);
              if (var2 < 0) {
                return "Unknown? (Got " + var2 + ")";
              } else {
                String var3 =
                    String.format("%4s", new Object[] {Integer.toBinaryString(var2)})
                        .replace(" ", "0");
                return String.format(
                    "%1$d / 0x%1$X / 0b%2$s", new Object[] {Integer.valueOf(var2), var3});
              }
            }
          });
    }
  }
Exemplo n.º 2
0
  public void addInfoToCrashReport(CrashReportCategory reportCategory) {
    reportCategory.setDetail(
        "Name",
        new ICrashReportDetail<String>() {
          public String call() throws Exception {
            return (String) TileEntity.classToNameMap.get(TileEntity.this.getClass())
                + " // "
                + TileEntity.this.getClass().getCanonicalName();
          }
        });

    if (this.worldObj != null) {
      CrashReportCategory.addBlockInfo(
          reportCategory, this.pos, this.getBlockType(), this.getBlockMetadata());
      reportCategory.setDetail(
          "Actual block type",
          new ICrashReportDetail<String>() {
            public String call() throws Exception {
              int i =
                  Block.getIdFromBlock(
                      TileEntity.this.worldObj.getBlockState(TileEntity.this.pos).getBlock());

              try {
                return String.format(
                    "ID #%d (%s // %s)",
                    new Object[] {
                      Integer.valueOf(i),
                      Block.getBlockById(i).getUnlocalizedName(),
                      Block.getBlockById(i).getClass().getCanonicalName()
                    });
              } catch (Throwable var3) {
                return "ID #" + i;
              }
            }
          });
      reportCategory.setDetail(
          "Actual block data value",
          new ICrashReportDetail<String>() {
            public String call() throws Exception {
              IBlockState iblockstate = TileEntity.this.worldObj.getBlockState(TileEntity.this.pos);
              int i = iblockstate.getBlock().getMetaFromState(iblockstate);

              if (i < 0) {
                return "Unknown? (Got " + i + ")";
              } else {
                String s =
                    String.format("%4s", new Object[] {Integer.toBinaryString(i)})
                        .replace(" ", "0");
                return String.format(
                    "%1$d / 0x%1$X / 0b%2$s", new Object[] {Integer.valueOf(i), s});
              }
            }
          });
    }
  }