@ForgeSubscribe
  @SideOnly(Side.CLIENT)
  public void postTextureHook(TextureStitchEvent.Post event) {
    for (BlockFluidFinite block : ResonantInduction.blockMixtureFluids.values()) {
      block.getFluid().setIcons(RenderUtility.getIcon(Reference.PREFIX + "mixture_flow"));
      ((FluidColored) block.getFluid())
          .setColor(
              ResourceGenerator.getColor(
                  ResourceGenerator.mixtureToMaterial(block.getFluid().getName())));
    }

    for (BlockFluidFinite block : ResonantInduction.blockMoltenFluid.values()) {
      block.getFluid().setIcons(RenderUtility.getIcon(Reference.PREFIX + "molten_flow"));
      ((FluidColored) block.getFluid())
          .setColor(
              ResourceGenerator.getColor(
                  ResourceGenerator.moltenToMaterial(block.getFluid().getName())));
    }
  }
  @ForgeSubscribe
  @SideOnly(Side.CLIENT)
  public void preTextureHook(TextureStitchEvent.Pre event) {
    if (event.map.textureType == 0) {
      RenderUtility.registerIcon(Reference.PREFIX + "glyph_0", event.map);
      RenderUtility.registerIcon(Reference.PREFIX + "glyph_1", event.map);
      RenderUtility.registerIcon(Reference.PREFIX + "glyph_2", event.map);
      RenderUtility.registerIcon(Reference.PREFIX + "glyph_3", event.map);

      RenderUtility.registerIcon(Reference.PREFIX + "mixture_flow", event.map);
      RenderUtility.registerIcon(Reference.PREFIX + "molten_flow", event.map);
      RenderUtility.registerIcon(Reference.PREFIX + "multimeter_screen", event.map);
      RenderUtility.registerIcon(Reference.PREFIX + "tankEdge", event.map);
    }
  }
Beispiel #3
0
  public void renderArrow(
      EntityFragments suiPian, double par2, double par4, double par6, float par8, float par9) {
    if (suiPian.isAnvil) {
      GL11.glPushMatrix();
      GL11.glTranslatef((float) par2, (float) par4, (float) par6);
      RenderUtility.setTerrainTexture();
      Block block = Block.anvil;
      World world = suiPian.worldObj;
      GL11.glDisable(GL11.GL_LIGHTING);

      this.renderBlocks.blockAccess = world;
      Tessellator var12 = Tessellator.instance;
      var12.startDrawingQuads();
      var12.setTranslation(
          (-MathHelper.floor_double(suiPian.posX)) - 0.5F,
          (-MathHelper.floor_double(suiPian.posY)) - 0.5F,
          (-MathHelper.floor_double(suiPian.posZ)) - 0.5F);
      this.renderBlocks.renderBlockByRenderType(
          block,
          MathHelper.floor_double(suiPian.posX),
          MathHelper.floor_double(suiPian.posY),
          MathHelper.floor_double(suiPian.posZ));
      var12.setTranslation(0.0D, 0.0D, 0.0D);
      var12.draw();

      GL11.glEnable(GL11.GL_LIGHTING);
      GL11.glPopMatrix();
    } else {
      this.bindTexture(TEXTURE_FILE);
      GL11.glPushMatrix();
      GL11.glTranslatef((float) par2, (float) par4, (float) par6);
      GL11.glRotatef(
          suiPian.prevRotationYaw + (suiPian.rotationYaw - suiPian.prevRotationYaw) * par9 - 90.0F,
          0.0F,
          1.0F,
          0.0F);
      GL11.glRotatef(
          suiPian.prevRotationPitch + (suiPian.rotationPitch - suiPian.prevRotationPitch) * par9,
          0.0F,
          0.0F,
          1.0F);
      Tessellator var10 = Tessellator.instance;
      byte var11 = 0;
      float var12 = 0.0F;
      float var13 = 0.5F;
      float var14 = (0 + var11 * 10) / 32.0F;
      float var15 = (5 + var11 * 10) / 32.0F;
      float var16 = 0.0F;
      float var17 = 0.15625F;
      float var18 = (5 + var11 * 10) / 32.0F;
      float var19 = (10 + var11 * 10) / 32.0F;
      float var20 = 0.05625F;
      GL11.glEnable(GL12.GL_RESCALE_NORMAL);
      float var21 = suiPian.arrowShake - par9;

      if (var21 > 0.0F) {
        float var22 = -MathHelper.sin(var21 * 3.0F) * var21;
        GL11.glRotatef(var22, 0.0F, 0.0F, 1.0F);
      }

      GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.0F);
      GL11.glScalef(var20, var20, var20);
      GL11.glTranslatef(-4.0F, 0.0F, 0.0F);
      GL11.glNormal3f(var20, 0.0F, 0.0F);
      var10.startDrawingQuads();
      var10.addVertexWithUV(-7.0D, -2.0D, -2.0D, var16, var18);
      var10.addVertexWithUV(-7.0D, -2.0D, 2.0D, var17, var18);
      var10.addVertexWithUV(-7.0D, 2.0D, 2.0D, var17, var19);
      var10.addVertexWithUV(-7.0D, 2.0D, -2.0D, var16, var19);
      var10.draw();
      GL11.glNormal3f(-var20, 0.0F, 0.0F);
      var10.startDrawingQuads();
      var10.addVertexWithUV(-7.0D, 2.0D, -2.0D, var16, var18);
      var10.addVertexWithUV(-7.0D, 2.0D, 2.0D, var17, var18);
      var10.addVertexWithUV(-7.0D, -2.0D, 2.0D, var17, var19);
      var10.addVertexWithUV(-7.0D, -2.0D, -2.0D, var16, var19);
      var10.draw();

      for (int var23 = 0; var23 < 4; ++var23) {
        GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
        GL11.glNormal3f(0.0F, 0.0F, var20);
        var10.startDrawingQuads();
        var10.addVertexWithUV(-8.0D, -2.0D, 0.0D, var12, var14);
        var10.addVertexWithUV(8.0D, -2.0D, 0.0D, var13, var14);
        var10.addVertexWithUV(8.0D, 2.0D, 0.0D, var13, var15);
        var10.addVertexWithUV(-8.0D, 2.0D, 0.0D, var12, var15);
        var10.draw();
      }

      GL11.glDisable(GL12.GL_RESCALE_NORMAL);
      GL11.glPopMatrix();
    }
  }