Пример #1
0
  /**
   * Renders the specified entity with the passed in position, yaw, and partialTickTime. Args:
   * entity, x, y, z, yaw, partialTickTime
   */
  public void renderEntityWithPosYaw(
      Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {
    Render render = null;

    try {
      render = this.getEntityRenderObject(par1Entity);

      if (render != null && this.renderEngine != null) {
        if (field_85095_o && !par1Entity.isInvisible()) {
          try {
            this.func_85094_b(par1Entity, par2, par4, par6, par8, par9);
          } catch (Throwable throwable) {
            throw new ReportedException(
                CrashReport.makeCrashReport(throwable, "Rendering entity hitbox in world"));
          }
        }

        try {
          render.doRender(par1Entity, par2, par4, par6, par8, par9);
        } catch (Throwable throwable1) {
          throw new ReportedException(
              CrashReport.makeCrashReport(throwable1, "Rendering entity in world"));
        }

        try {
          render.doRenderShadowAndFire(par1Entity, par2, par4, par6, par8, par9);
        } catch (Throwable throwable2) {
          throw new ReportedException(
              CrashReport.makeCrashReport(throwable2, "Post-rendering entity in world"));
        }
      }
    } catch (Throwable throwable3) {
      CrashReport crashreport =
          CrashReport.makeCrashReport(throwable3, "Rendering entity in world");
      CrashReportCategory crashreportcategory = crashreport.makeCategory("Entity being rendered");
      par1Entity.func_85029_a(crashreportcategory);
      CrashReportCategory crashreportcategory1 = crashreport.makeCategory("Renderer details");
      crashreportcategory1.addCrashSection("Assigned renderer", render);
      crashreportcategory1.addCrashSection(
          "Location", CrashReportCategory.func_85074_a(par2, par4, par6));
      crashreportcategory1.addCrashSection("Rotation", Float.valueOf(par8));
      crashreportcategory1.addCrashSection("Delta", Float.valueOf(par9));
      throw new ReportedException(crashreport);
    }
  }
Пример #2
0
  /**
   * Renders the entity's shadow and fire (if its on fire). Args: entity, x, y, z, yaw,
   * partialTickTime
   */
  public void doRenderShadowAndFire(
      Entity entityIn, double x, double y, double z, float yaw, float partialTicks) {
    if (this.renderManager.options != null) {
      if (this.renderManager.options.entityShadows
          && this.shadowSize > 0.0F
          && !entityIn.isInvisible()
          && this.renderManager.isRenderShadow()) {
        double d0 =
            this.renderManager.getDistanceToCamera(entityIn.posX, entityIn.posY, entityIn.posZ);
        float f = (float) ((1.0D - d0 / 256.0D) * (double) this.shadowOpaque);

        if (f > 0.0F) {
          this.renderShadow(entityIn, x, y, z, f, partialTicks);
        }
      }

      if (entityIn.canRenderOnFire()
          && (!(entityIn instanceof EntityPlayer) || !((EntityPlayer) entityIn).isSpectator())) {
        this.renderEntityOnFire(entityIn, x, y, z, partialTicks);
      }
    }
  }