Пример #1
0
 public void func_85027_a(CrashReportCategory par1CrashReportCategory) {
   par1CrashReportCategory.addCrashSectionCallable("Name", new CallableItemEntityName(this));
   par1CrashReportCategory.addCrashSectionCallable(
       "Actual item type", new CallableItemEntityType(this));
   par1CrashReportCategory.addCrashSectionCallable(
       "Actual item data value", new CallableItemEntityData(this));
 }
Пример #2
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});
              }
            }
          });
    }
  }
  private void updateEffects() {
    for (int k = 0; k < fxes.length; ++k) {

      for (int j = 0; j < this.fxes[k].size(); ++j) {
        final EntityFX entityfx = this.fxes[k].get(j);

        try {
          if (entityfx != null) {
            entityfx.onUpdate();
          }
        } catch (Throwable throwable) {
          CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Ticking Particle");
          CrashReportCategory crashreportcategory =
              crashreport.makeCategory("Particle being ticked");
          crashreportcategory.addCrashSectionCallable(
              "Particle",
              new Callable() {
                private static final String __OBFID = "CL_00000916";

                public String call() {
                  return entityfx.toString();
                }
              });
          throw new ReportedException(crashreport);
        }

        if (entityfx == null || entityfx.isDead) {
          this.fxes[k].remove(j--);
        }
      }
    }
  }
Пример #4
0
  public boolean loadTexture(ResourceLocation textureLocation, ITextureObject textureObj) {
    boolean flag = true;

    try {
      ((ITextureObject) textureObj).loadTexture(this.theResourceManager);
    } catch (IOException ioexception) {
      logger.warn((String) ("Failed to load texture: " + textureLocation), (Throwable) ioexception);
      textureObj = TextureUtil.missingTexture;
      this.mapTextureObjects.put(textureLocation, (ITextureObject) textureObj);
      flag = false;
    } catch (Throwable throwable) {
      final ITextureObject textureObjf = textureObj;
      CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Registering texture");
      CrashReportCategory crashreportcategory =
          crashreport.makeCategory("Resource location being registered");
      crashreportcategory.addCrashSection("Resource location", textureLocation);
      crashreportcategory.addCrashSectionCallable(
          "Texture object class",
          new Callable<String>() {
            public String call() throws Exception {
              return textureObjf.getClass().getName();
            }
          });
      throw new ReportedException(crashreport);
    }

    this.mapTextureObjects.put(textureLocation, (ITextureObject) textureObj);
    return flag;
  }
  public boolean loadTexture(ResourceLocation p_110579_1_, final ITextureObject p_110579_2_) {
    boolean flag = true;
    ITextureObject p_110579_2_2 = p_110579_2_;

    try {
      ((ITextureObject) p_110579_2_).loadTexture(this.theResourceManager);
    } catch (IOException ioexception) {
      logger.warn("Failed to load texture: " + p_110579_1_, ioexception);
      p_110579_2_2 = TextureUtil.missingTexture;
      this.mapTextureObjects.put(p_110579_1_, p_110579_2_2);
      flag = false;
    } catch (Throwable throwable) {
      CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Registering texture");
      CrashReportCategory crashreportcategory =
          crashreport.makeCategory("Resource location being registered");
      crashreportcategory.addCrashSection("Resource location", p_110579_1_);
      crashreportcategory.addCrashSectionCallable(
          "Texture object class",
          new Callable() {
            private static final String __OBFID = "CL_00001065";

            public String call() {
              return p_110579_2_.getClass().getName();
            }
          });
      throw new ReportedException(crashreport);
    }

    this.mapTextureObjects.put(p_110579_1_, p_110579_2_2);
    return flag;
  }
Пример #6
0
  protected static boolean func_151616_a(final int p_151616_0_, final int p_151616_1_) {
    if (p_151616_0_ == p_151616_1_) {
      return true;
    } else if (p_151616_0_ != BiomeGenBase.field_150607_aa.biomeID
        && p_151616_0_ != BiomeGenBase.field_150608_ab.biomeID) {
      try {
        return BiomeGenBase.func_150568_d(p_151616_0_) != null
                && BiomeGenBase.func_150568_d(p_151616_1_) != null
            ? BiomeGenBase.func_150568_d(p_151616_0_)
                .func_150569_a(BiomeGenBase.func_150568_d(p_151616_1_))
            : false;
      } catch (Throwable var5) {
        CrashReport var3 = CrashReport.makeCrashReport(var5, "Comparing biomes");
        CrashReportCategory var4 = var3.makeCategory("Biomes being compared");
        var4.addCrashSection("Biome A ID", Integer.valueOf(p_151616_0_));
        var4.addCrashSection("Biome B ID", Integer.valueOf(p_151616_1_));
        var4.addCrashSectionCallable(
            "Biome A",
            new Callable() {
              private static final String __OBFID = "CL_00000560";

              public String call() {
                return String.valueOf(BiomeGenBase.func_150568_d(p_151616_0_));
              }
            });
        var4.addCrashSectionCallable(
            "Biome B",
            new Callable() {
              private static final String __OBFID = "CL_00000561";

              public String call() {
                return String.valueOf(BiomeGenBase.func_150568_d(p_151616_1_));
              }
            });
        throw new ReportedException(var3);
      }
    } else {
      return p_151616_1_ == BiomeGenBase.field_150607_aa.biomeID
          || p_151616_1_ == BiomeGenBase.field_150608_ab.biomeID;
    }
  }
Пример #7
0
  public static void populateCrashReport(CrashReport crashReport) {
    if (EventProxy.error != null) {
      CrashReportCategory category = crashReport.makeCategoryDepth("Event Handler Error", 1);

      category.addCrashSectionCallable(
          EventProxy.error,
          new Callable<String>() {
            @Override
            public String call() throws Exception {
              return EventProxy.errorDetails.toString();
            }
          });
    }
  }
  public void renderParticles(Entity entity, float f) {
    float f1 = ActiveRenderInfo.rotationX;
    float f2 = ActiveRenderInfo.rotationZ;
    float f3 = ActiveRenderInfo.rotationYZ;
    float f4 = ActiveRenderInfo.rotationXY;
    float f5 = ActiveRenderInfo.rotationXZ;
    EntityFX.interpPosX = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * (double) f;
    EntityFX.interpPosY = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * (double) f;
    EntityFX.interpPosZ = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * (double) f;

    for (int k = 0; k < fxes.length; ++k) {
      if (!this.fxes[k].isEmpty()) {
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        GL11.glDepthMask(false);
        GL11.glEnable(GL11.GL_BLEND);
        switch (k) {
          case 0:
            GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
            renderer.bindTexture(additiveTextureSheet);
            break;
        }

        GL11.glAlphaFunc(GL11.GL_GREATER, 0.003921569F);
        Tessellator tessellator = Tessellator.instance;
        tessellator.startDrawingQuads();

        for (int j = 0; j < this.fxes[k].size(); ++j) {
          final EntityFX entityfx = this.fxes[k].get(j);
          if (entityfx == null) continue;
          tessellator.setBrightness(entityfx.getBrightnessForRender(f));

          try {
            entityfx.renderParticle(tessellator, f, f1, f5, f2, f3, f4);
          } catch (Throwable throwable) {
            CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Rendering Particle");
            CrashReportCategory crashreportcategory =
                crashreport.makeCategory("Particle being rendered");
            crashreportcategory.addCrashSectionCallable("Particle", entityfx::toString);
            throw new ReportedException(crashreport);
          }
        }

        tessellator.draw();
        GL11.glDisable(GL11.GL_BLEND);
        GL11.glDepthMask(true);
        GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
      }
    }
  }