Ejemplo n.º 1
0
  private void renderSimpleGeode(
      IBlockAccess world, int x, int y, int z, Block b, int meta, RenderBlocks rb) {
    IIcon icos = ((BlockTieredOre) b).getGeodeStoneIcon(Math.abs(x + y * x * z + z) % 16);
    IIcon ico = ((BlockTieredOre) b).getGeodeIcon(meta);

    if (b.shouldSideBeRendered(world, x, y - 1, z, ForgeDirection.DOWN.ordinal()))
      rb.renderFaceYNeg(b, x, y, z, icos);
    if (b.shouldSideBeRendered(world, x, y + 1, z, ForgeDirection.UP.ordinal()))
      rb.renderFaceYPos(b, x, y, z, icos);
    if (b.shouldSideBeRendered(world, x, y, z - 1, ForgeDirection.NORTH.ordinal()))
      rb.renderFaceZNeg(b, x, y, z, icos);
    if (b.shouldSideBeRendered(world, x, y, z + 1, ForgeDirection.SOUTH.ordinal()))
      rb.renderFaceZPos(b, x, y, z, icos);
    if (b.shouldSideBeRendered(world, x - 1, y, z, ForgeDirection.WEST.ordinal()))
      rb.renderFaceXNeg(b, x, y, z, icos);
    if (b.shouldSideBeRendered(world, x + 1, y, z, ForgeDirection.EAST.ordinal()))
      rb.renderFaceXPos(b, x, y, z, icos);

    Tessellator.instance.setBrightness(240);
    Tessellator.instance.setColorOpaque(255, 255, 255);
    double d = 0.0025;

    if (b.shouldSideBeRendered(world, x, y - 1, z, ForgeDirection.DOWN.ordinal()))
      rb.renderFaceYNeg(b, x, y + d, z, ico);
    if (b.shouldSideBeRendered(world, x, y + 1, z, ForgeDirection.UP.ordinal()))
      rb.renderFaceYPos(b, x, y - d, z, ico);
    if (b.shouldSideBeRendered(world, x, y, z - 1, ForgeDirection.NORTH.ordinal()))
      rb.renderFaceZNeg(b, x, y, z + d, ico);
    if (b.shouldSideBeRendered(world, x, y, z + 1, ForgeDirection.SOUTH.ordinal()))
      rb.renderFaceZPos(b, x, y, z - d, ico);
    if (b.shouldSideBeRendered(world, x - 1, y, z, ForgeDirection.WEST.ordinal()))
      rb.renderFaceXNeg(b, x + d, y, z, ico);
    if (b.shouldSideBeRendered(world, x + 1, y, z, ForgeDirection.EAST.ordinal()))
      rb.renderFaceXPos(b, x - d, y, z, ico);
  }
Ejemplo n.º 2
0
 public static void drawBlock(Block block, IIcon icon, RenderBlocks renderer) {
   Tessellator tessellator = Tessellator.instance;
   tessellator.startDrawingQuads();
   tessellator.setNormal(0.0F, -1.0F, 0.0F);
   renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, icon);
   tessellator.draw();
   tessellator.startDrawingQuads();
   tessellator.setNormal(0.0F, 1.0F, 0.0F);
   renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, icon);
   tessellator.draw();
   tessellator.startDrawingQuads();
   tessellator.setNormal(0.0F, 0.0F, -1.0F);
   renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, icon);
   tessellator.draw();
   tessellator.startDrawingQuads();
   tessellator.setNormal(0.0F, 0.0F, 1.0F);
   renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, icon);
   tessellator.draw();
   tessellator.startDrawingQuads();
   tessellator.setNormal(-1.0F, 0.0F, 0.0F);
   renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, icon);
   tessellator.draw();
   tessellator.startDrawingQuads();
   tessellator.setNormal(1.0F, 0.0F, 0.0F);
   renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, icon);
   tessellator.draw();
 }
Ejemplo n.º 3
0
 public static void renderInvBlock(Block block, int m, RenderBlocks renderer) {
   Tessellator var14 = Tessellator.instance;
   GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
   var14.startDrawingQuads();
   var14.setNormal(0.0F, -1.0F, 0.0F);
   renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, m));
   var14.draw();
   var14.startDrawingQuads();
   var14.setNormal(0.0F, 1.0F, 0.0F);
   renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, m));
   var14.draw();
   var14.startDrawingQuads();
   var14.setNormal(0.0F, 0.0F, -1.0F);
   renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, m));
   var14.draw();
   var14.startDrawingQuads();
   var14.setNormal(0.0F, 0.0F, 1.0F);
   renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(3, m));
   var14.draw();
   var14.startDrawingQuads();
   var14.setNormal(-1.0F, 0.0F, 0.0F);
   renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(4, m));
   var14.draw();
   var14.startDrawingQuads();
   var14.setNormal(1.0F, 0.0F, 0.0F);
   renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, m));
   var14.draw();
   GL11.glTranslatef(0.5F, 0.5F, 0.5F);
 }
Ejemplo n.º 4
0
 public void drawFace(
     ForgeDirection side,
     Block block,
     double x,
     double y,
     double z,
     Icon icon,
     RenderBlocks renderer) {
   switch (side) {
     case UP:
       renderer.renderFaceYPos(block, x, y, z, icon);
       break;
     case DOWN:
       renderer.renderFaceYNeg(block, x, y, z, icon);
       break;
     case NORTH:
       renderer.renderFaceZNeg(block, x, y, z, icon);
       break;
     case EAST:
       renderer.renderFaceXPos(block, x, y, z, icon);
       break;
     case SOUTH:
       renderer.renderFaceZPos(block, x, y, z, icon);
       break;
     case WEST:
       renderer.renderFaceXNeg(block, x, y, z, icon);
       break;
     case UNKNOWN:
       break;
   }
 }
Ejemplo n.º 5
0
  public static void drawBlock(Block block, int meta, RenderBlocks renderer) {
    Tessellator tessellator = Tessellator.instance;

    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, -1.0F, 0.0F);
    renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, meta));
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 1.0F, 0.0F);
    renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, meta));
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 0.0F, -1.0F);
    renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, meta));
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 0.0F, 1.0F);
    renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(3, meta));
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(-1.0F, 0.0F, 0.0F);
    renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(4, meta));
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(1.0F, 0.0F, 0.0F);
    renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, meta));
    tessellator.draw();
  }
Ejemplo n.º 6
0
 private void renderInInventory(
     Tessellator tessellator, RenderBlocks renderer, Block block, int metadata) {
   GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
   tessellator.startDrawingQuads();
   tessellator.setNormal(0.0F, -1F, 0.0F);
   renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, metadata));
   tessellator.draw();
   tessellator.startDrawingQuads();
   tessellator.setNormal(0.0F, 1.0F, 0.0F);
   renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, metadata));
   tessellator.draw();
   tessellator.startDrawingQuads();
   tessellator.setNormal(0.0F, 0.0F, -1F);
   renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, metadata));
   tessellator.draw();
   tessellator.startDrawingQuads();
   tessellator.setNormal(0.0F, 0.0F, 1.0F);
   renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(3, metadata));
   tessellator.draw();
   tessellator.startDrawingQuads();
   tessellator.setNormal(-1F, 0.0F, 0.0F);
   renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(4, metadata));
   tessellator.draw();
   tessellator.startDrawingQuads();
   tessellator.setNormal(1.0F, 0.0F, 0.0F);
   renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, metadata));
   tessellator.draw();
   GL11.glTranslatef(0.5F, 0.5F, 0.5F);
 }
 private void renderStandardBlock(Block block, int meta, RenderBlocks renderer) {
   Tessellator tessellator = Tessellator.instance;
   GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
   tessellator.startDrawingQuads();
   tessellator.setNormal(0.0F, -1.0F, 0.0F);
   renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, meta));
   tessellator.draw();
   tessellator.startDrawingQuads();
   tessellator.setNormal(0.0F, 1.0F, 0.0F);
   renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, meta));
   tessellator.draw();
   tessellator.startDrawingQuads();
   tessellator.setNormal(0.0F, 0.0F, -1.0F);
   renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, meta));
   tessellator.draw();
   tessellator.startDrawingQuads();
   tessellator.setNormal(0.0F, 0.0F, 1.0F);
   renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(3, meta));
   tessellator.draw();
   tessellator.startDrawingQuads();
   tessellator.setNormal(-1.0F, 0.0F, 0.0F);
   renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(4, meta));
   tessellator.draw();
   tessellator.startDrawingQuads();
   tessellator.setNormal(1.0F, 0.0F, 0.0F);
   renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, meta));
   tessellator.draw();
   GL11.glTranslatef(0.5F, 0.5F, 0.5F);
 }
 private static void renderStandardBlock(RenderBlocks var0, Block var1, int var2) {
   GL11.glPushMatrix();
   final Tessellator var3 = Tessellator.instance;
   GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
   GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
   var3.startDrawingQuads();
   var3.setNormal(0.0F, -1.0F, 0.0F);
   var0.renderFaceYNeg(var1, 0.0D, 0.0D, 0.0D, var1.getIcon(0, var2));
   var3.draw();
   var3.startDrawingQuads();
   var3.setNormal(0.0F, 1.0F, 0.0F);
   var0.renderFaceYPos(var1, 0.0D, 0.0D, 0.0D, var1.getIcon(1, var2));
   var3.draw();
   var3.startDrawingQuads();
   var3.setNormal(0.0F, 0.0F, -1.0F);
   var0.renderFaceXPos(var1, 0.0D, 0.0D, 0.0D, var1.getIcon(2, var2));
   var3.draw();
   var3.startDrawingQuads();
   var3.setNormal(0.0F, 0.0F, 1.0F);
   var0.renderFaceXNeg(var1, 0.0D, 0.0D, 0.0D, var1.getIcon(3, var2));
   var3.draw();
   var3.startDrawingQuads();
   var3.setNormal(-1.0F, 0.0F, 0.0F);
   var0.renderFaceZNeg(var1, 0.0D, 0.0D, 0.0D, var1.getIcon(4, var2));
   var3.draw();
   var3.startDrawingQuads();
   var3.setNormal(1.0F, 0.0F, 0.0F);
   var0.renderFaceZPos(var1, 0.0D, 0.0D, 0.0D, var1.getIcon(5, var2));
   var3.draw();
   GL11.glPopMatrix();
 }
Ejemplo n.º 9
0
  @Override
  public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
    RenderBlocks renderer = (RenderBlocks) data[0];
    int metadata = item.getItemDamage();
    GL11.glPushMatrix();
    renderer.setOverrideBlockTexture(PillarMaterials.values()[metadata].block.getIcon(0, 0));
    Tessellator tessellator = Tessellator.instance;
    renderer.setRenderBoundsFromBlock(this.bl);
    GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 0.0F, -1.0F);
    renderer.renderFaceZNeg(this.bl, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(this.bl, 0));
    tessellator.draw();

    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 0.0F, 1.0F);
    renderer.renderFaceZPos(this.bl, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSide(this.bl, 0));
    tessellator.draw();

    renderer.clearOverrideBlockTexture();
    GL11.glTranslatef(0.5F, 0.5F, 0.5F);
    GL11.glPushMatrix();
    GL11.glRotatef(180, 0F, 1F, 0F);
    Minecraft.getMinecraft().renderEngine.bindTexture(this.textureFrame);
    this.modelFrame.renderAll();
    GL11.glPopMatrix();

    GL11.glPopMatrix();
  }
 @Override
 public boolean renderWorldBlock(
     IBlockAccess world, int x, int y, int z, Block b, int modelId, RenderBlocks rb) {
   Tessellator v5 = Tessellator.instance;
   int meta = world.getBlockMetadata(x, y, z);
   if (renderPass == 0) {
     int color = b.colorMultiplier(world, x, y, z);
     float red = ReikaColorAPI.getRed(color) / 255F;
     float grn = ReikaColorAPI.getGreen(color) / 255F;
     float blu = ReikaColorAPI.getBlue(color) / 255F;
     rb.renderStandardBlockWithAmbientOcclusion(b, x, y, z, red, grn, blu);
     return true;
   } else if (renderPass == 1) {
     LightedTreeBlock ltb = (LightedTreeBlock) b;
     IIcon ico = ltb.getOverlay(meta);
     v5.setBrightness(240);
     v5.setColorRGBA_I(0xffffff, b instanceof BlockLeavesBase ? 255 : 220);
     if (ltb.renderOverlayOnSide(0, meta)) rb.renderFaceYNeg(b, x, y, z, ico);
     if (ltb.renderOverlayOnSide(1, meta)) rb.renderFaceYPos(b, x, y, z, ico);
     if (ltb.renderOverlayOnSide(2, meta)) rb.renderFaceZNeg(b, x, y, z, ico);
     if (ltb.renderOverlayOnSide(3, meta)) rb.renderFaceZPos(b, x, y, z, ico);
     if (ltb.renderOverlayOnSide(4, meta)) rb.renderFaceXNeg(b, x, y, z, ico);
     if (ltb.renderOverlayOnSide(5, meta)) rb.renderFaceXPos(b, x, y, z, ico);
     return true;
   }
   return false;
 }
Ejemplo n.º 11
0
 public static void renderAllFaces(
     RenderBlocks renderer, Block block, int x, int y, int z, IIcon icon) {
   renderer.renderFaceYNeg(block, x, y, z, icon);
   renderer.renderFaceYPos(block, x, y, z, icon);
   renderer.renderFaceZNeg(block, x, y, z, icon);
   renderer.renderFaceZPos(block, x, y, z, icon);
   renderer.renderFaceXNeg(block, x, y, z, icon);
   renderer.renderFaceXPos(block, x, y, z, icon);
 }
Ejemplo n.º 12
0
  public static void renderRodInInventory(Block block, int metadata, RenderBlocks renderer) {

    renderer.setRenderBounds(0.375F, 0.375F, 0.01F, 0.625F, 0.625F, 0.99F);
    renderer.uvRotateSouth = 2;
    renderer.uvRotateNorth = 1;
    renderer.uvRotateTop = 3;
    renderer.uvRotateBottom = 3;

    if (block instanceof BaseBlock) {
      if (((BaseBlock) block).data instanceof BRodPart) {
        renderer.setRenderBounds(0.375F, 0.375F, 0.01F, 0.625F, 0.625F, 0.50F);
        GL11.glTranslatef(0F, 0F, 0.25F);
      }
    }

    Tessellator tessellator = Tessellator.instance;
    GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, -1.0F, 0.0F);
    renderer.renderFaceYNeg(
        block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 0, metadata));
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 1.0F, 0.0F);
    renderer.renderFaceYPos(
        block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 1, metadata));
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 0.0F, -1.0F);
    renderer.renderFaceZNeg(
        block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 2, metadata));
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 0.0F, 1.0F);
    renderer.renderFaceZPos(
        block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 3, metadata));
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(-1.0F, 0.0F, 0.0F);
    renderer.renderFaceXNeg(
        block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 4, metadata));
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(1.0F, 0.0F, 0.0F);
    renderer.renderFaceXPos(
        block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 5, metadata));
    tessellator.draw();
    GL11.glTranslatef(0.5F, 0.5F, 0.5F);

    renderer.uvRotateEast = 0;
    renderer.uvRotateWest = 0;
    renderer.uvRotateSouth = 0;
    renderer.uvRotateNorth = 0;
    renderer.uvRotateTop = 0;
    renderer.uvRotateBottom = 0;
    renderer.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D);
  }
Ejemplo n.º 13
0
  @Override
  public boolean renderWorldBlock(
      IBlockAccess world, int x, int y, int z, Block b, int modelId, RenderBlocks rb) {
    Tessellator v5 = Tessellator.instance;
    int meta = world.getBlockMetadata(x, y, z);
    /*
    float f1 = 0.5F;
    float f2 = 1;
    float f3 = 0.8F;
    float f4 = 0.8F;
    float f5 = 0.6F;
    float f6 = 0.6F;


    v5.setBrightness(rb.renderMinY > 0.0D ? l : b.getMixedBrightnessForBlock(world, x, y - 1, z));
    v5.setColorOpaque_F(f1, f1, f1);
    rb.renderFaceYNeg(b, x, y, z, ico);

    v5.setBrightness(rb.renderMaxY < 1.0D ? l : b.getMixedBrightnessForBlock(world, x, y + 1, z));
    v5.setColorOpaque_F(f2, f2, f2);
    rb.renderFaceYPos(b, x, y, z, ico);

    v5.setBrightness(rb.renderMinZ > 0.0D ? l : b.getMixedBrightnessForBlock(world, x, y, z - 1));
    v5.setColorOpaque_F(f3, f3, f3);
    rb.renderFaceZNeg(b, x, y, z, ico);

    v5.setBrightness(rb.renderMaxZ < 1.0D ? l : b.getMixedBrightnessForBlock(world, x, y, z + 1));
    v5.setColorOpaque_F(f4, f4, f4);
    rb.renderFaceZPos(b, x, y, z, ico);

    v5.setBrightness(rb.renderMinX > 0.0D ? l : b.getMixedBrightnessForBlock(world, x - 1, y, z));
    v5.setColorOpaque_F(f5, f5, f5);
    rb.renderFaceXNeg(b, x, y, z, ico);

    v5.setBrightness(rb.renderMaxX < 1.0D ? l : b.getMixedBrightnessForBlock(world, x + 1, y, z));
    v5.setColorOpaque_F(f6, f6, f6);
    rb.renderFaceXPos(b, x, y, z, ico);
     */
    rb.renderStandardBlockWithAmbientOcclusion(b, x, y, z, 1, 1, 1);

    IIcon ico = CrystalElement.elements[meta].getFaceRune();
    v5.setBrightness(240);
    v5.setColorOpaque_F(255, 255, 255);
    if (b.shouldSideBeRendered(world, x, y - 1, z, ForgeDirection.DOWN.ordinal()))
      rb.renderFaceYNeg(b, x, y, z, ico);
    if (b.shouldSideBeRendered(world, x, y + 1, z, ForgeDirection.UP.ordinal()))
      rb.renderFaceYPos(b, x, y, z, ico);
    if (b.shouldSideBeRendered(world, x, y, z - 1, ForgeDirection.NORTH.ordinal()))
      rb.renderFaceZNeg(b, x, y, z, ico);
    if (b.shouldSideBeRendered(world, x, y, z + 1, ForgeDirection.SOUTH.ordinal()))
      rb.renderFaceZPos(b, x, y, z, ico);
    if (b.shouldSideBeRendered(world, x - 1, y, z, ForgeDirection.WEST.ordinal()))
      rb.renderFaceXNeg(b, x, y, z, ico);
    if (b.shouldSideBeRendered(world, x + 1, y, z, ForgeDirection.EAST.ordinal()))
      rb.renderFaceXPos(b, x, y, z, ico);
    return true;
  }
Ejemplo n.º 14
0
  @Override
  public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {

    if (block.getRenderType() == BuildCraftCore.blockByEntityModel) {

      EntityRenderIndex index = new EntityRenderIndex(block, metadata);
      if (blockByEntityRenders.containsKey(index)) {
        blockByEntityRenders.get(index).inventoryRender(-0.5, -0.5, -0.5, 0, 0);
      }

    } else if (block.getRenderType() == BuildCraftCore.legacyPipeModel) {
      Tessellator tessellator = Tessellator.instance;

      block.setBlockBounds(
          CoreConstants.PIPE_MIN_POS,
          0.0F,
          CoreConstants.PIPE_MIN_POS,
          CoreConstants.PIPE_MAX_POS,
          1.0F,
          CoreConstants.PIPE_MAX_POS);
      renderer.setRenderBoundsFromBlock(block);
      block.setBlockBoundsForItemRender();
      GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
      tessellator.startDrawingQuads();
      tessellator.setNormal(0.0F, -1F, 0.0F);
      renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, metadata));
      tessellator.draw();
      tessellator.startDrawingQuads();
      tessellator.setNormal(0.0F, 1.0F, 0.0F);
      renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, metadata));
      tessellator.draw();
      tessellator.startDrawingQuads();
      tessellator.setNormal(0.0F, 0.0F, -1F);
      renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, metadata));
      tessellator.draw();
      tessellator.startDrawingQuads();
      tessellator.setNormal(0.0F, 0.0F, 1.0F);
      renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(3, metadata));
      tessellator.draw();
      tessellator.startDrawingQuads();
      tessellator.setNormal(-1F, 0.0F, 0.0F);
      renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(4, metadata));
      tessellator.draw();
      tessellator.startDrawingQuads();
      tessellator.setNormal(1.0F, 0.0F, 0.0F);
      renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, metadata));
      tessellator.draw();
      GL11.glTranslatef(0.5F, 0.5F, 0.5F);
      block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
    }
  }
  public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
    Tessellator tessellator = Tessellator.instance;
    block.setBlockBoundsForItemRender();
    GL11.glTranslatef(-0.5F, -0.5F, -0.5F);

    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, -1.0F, 0.0F);
    renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, metadata));
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 1.0F, 0.0F);
    renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, metadata));
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 0.0F, -1.0F);
    tessellator.addTranslation(0.0F, 0.0F, 0.0F);
    renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, metadata));
    tessellator.addTranslation(0.0F, 0.0F, 0.0F);
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 0.0F, 1.0F);
    tessellator.addTranslation(0.0F, 0.0F, 0.0F);
    renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(3, metadata));
    tessellator.addTranslation(0.0F, 0.0F, 0.0F);
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(-1.0F, 0.0F, 0.0F);
    tessellator.addTranslation(0.0F, 0.0F, 0.0F);

    tessellator.setBrightness(15 << 20 | 15 << 6);
    tessellator.setColorRGBA_I(0xFFFFFF, 0xFF);
    int[] color = {0x1B2344, 0x895CA8, 0xDABDEF};
    BlockTerminalFluid terminal = (BlockTerminalFluid) block;
    renderer.renderFaceXNeg(block, 0, 0, 0, terminal.baseLayer);
    for (int i = 0; i < 3; i++) {
      tessellator.setColorRGBA_I(color[i], 0xFF);
      renderer.renderFaceXNeg(block, 0, 0, 0, terminal.colorLayers[i]);
    }

    tessellator.addTranslation(0.0F, 0.0F, 0.0F);
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(1.0F, 0.0F, 0.0F);
    tessellator.addTranslation(0.0F, 0.0F, 0.0F);
    renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, metadata));
    tessellator.addTranslation(0.0F, 0.0F, 0.0F);
    tessellator.draw();

    GL11.glTranslatef(0.5F, 0.5F, 0.5F);
  }
 private void renderPostAtOrigin(
     BlockThinLogFence block, int metadata, RenderBlocks renderer, Tessellator tessellator) {
   tessellator.startDrawingQuads();
   tessellator.setNormal(0.0F, -1.0F, 0.0F);
   renderer.renderFaceYNeg(
       block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 0, metadata));
   tessellator.draw();
   tessellator.startDrawingQuads();
   tessellator.setNormal(0.0F, 1.0F, 0.0F);
   renderer.renderFaceYPos(
       block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 1, metadata));
   tessellator.draw();
   tessellator.startDrawingQuads();
   tessellator.setNormal(0.0F, 0.0F, -1.0F);
   renderer.renderFaceZNeg(
       block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 2, metadata));
   renderer.renderFaceZNeg(block, 0, 0, .5f, block.getSideIcon());
   tessellator.draw();
   tessellator.startDrawingQuads();
   tessellator.setNormal(0.0F, 0.0F, 1.0F);
   renderer.renderFaceZPos(
       block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 3, metadata));
   renderer.renderFaceZPos(block, 0, 0, -.5f, block.getSideIcon());
   tessellator.draw();
   tessellator.startDrawingQuads();
   tessellator.setNormal(-1.0F, 0.0F, 0.0F);
   renderer.renderFaceXNeg(
       block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 4, metadata));
   renderer.renderFaceXNeg(block, .5f, 0, 0, block.getSideIcon());
   tessellator.draw();
   tessellator.startDrawingQuads();
   tessellator.setNormal(1.0F, 0.0F, 0.0F);
   renderer.renderFaceXPos(
       block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 5, metadata));
   renderer.renderFaceXPos(block, -.5f, 0, 0, block.getSideIcon());
   tessellator.draw();
 }
Ejemplo n.º 17
0
  public static void renderRodWithNBT(ItemStack stack, RenderBlocks renderer) {

    renderer.setRenderBounds(0.375F, 0.375F, 0.01F, 0.625F, 0.625F, 0.99F);
    renderer.uvRotateSouth = 2;
    renderer.uvRotateNorth = 1;
    renderer.uvRotateTop = 3;
    renderer.uvRotateBottom = 3;

    Tessellator tessellator = Tessellator.instance;
    Block block = BlockData.rod.block;

    GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, -1.0F, 0.0F);
    renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, ItemData.rod.item.getIcon(stack, 0));
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 1.0F, 0.0F);
    renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, ItemData.rod.item.getIcon(stack, 1));
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 0.0F, -1.0F);
    renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, ItemData.rod.item.getIcon(stack, 2));
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 0.0F, 1.0F);
    renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, ItemData.rod.item.getIcon(stack, 3));
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(-1.0F, 0.0F, 0.0F);
    renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, ItemData.rod.item.getIcon(stack, 4));
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(1.0F, 0.0F, 0.0F);
    renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, ItemData.rod.item.getIcon(stack, 5));
    tessellator.draw();

    GL11.glTranslatef(0.5F, 0.5F, 0.5F);

    renderer.uvRotateEast = 0;
    renderer.uvRotateWest = 0;
    renderer.uvRotateSouth = 0;
    renderer.uvRotateNorth = 0;
    renderer.uvRotateTop = 0;
    renderer.uvRotateBottom = 0;
    renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
  }
  private boolean renderWorldBlock(
      IBlockAccess world,
      int x,
      int y,
      int z,
      BlockThinLogFence block,
      int modelId,
      RenderBlocks renderer) {
    float margin = block.getMargin();

    renderer.setRenderBounds(margin, 0, margin, 1 - margin, 1, 1 - margin);
    renderer.renderStandardBlock(block, x, y, z);

    IIcon sideIcon = block.getSideIcon();

    boolean connectedZNeg = block.canConnectFenceTo(world, x, y, z - 1);
    boolean connectedZPos = block.canConnectFenceTo(world, x, y, z + 1);
    boolean connectedXNeg = block.canConnectFenceTo(world, x - 1, y, z);
    boolean connectedXPos = block.canConnectFenceTo(world, x + 1, y, z);

    if (connectedXNeg || connectedXPos) {
      if (connectedXNeg && connectedXPos) renderer.setRenderBounds(0, 0, .5, 1, 1, .5);
      else if (connectedXNeg) renderer.setRenderBounds(0, 0, .5, .5, 1, .5);
      else if (connectedXPos) renderer.setRenderBounds(.5, 0, .5, 1, 1, .5);

      renderer.flipTexture = true;
      renderer.renderFaceZNeg(block, x, y, z, sideIcon);
      renderer.flipTexture = false;
      renderer.renderFaceZPos(block, x, y, z, sideIcon);
    }

    if (connectedZNeg || connectedZPos) {
      if (connectedZNeg && connectedZPos) renderer.setRenderBounds(.5, 0, 0, .5, 1, 1);
      else if (connectedZNeg) renderer.setRenderBounds(.5, 0, 0, .5, 1, .5f);
      else if (connectedZPos) renderer.setRenderBounds(.5, 0, .5f, .5, 1, 1);

      renderer.flipTexture = true;
      renderer.renderFaceXPos(block, x, y, z, sideIcon);
      renderer.flipTexture = false;
      renderer.renderFaceXNeg(block, x, y, z, sideIcon);
    }

    return true;
  }
 private void renderInvCuboid(
     RenderBlocks renderer,
     Block block,
     float minX,
     float minY,
     float minZ,
     float maxX,
     float maxY,
     float maxZ,
     Icon icon) {
   Tessellator tessellator = Tessellator.instance;
   block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
   renderer.setRenderBoundsFromBlock(block);
   GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
   block.setBlockBounds(minX, minY, minZ, maxX, maxY, maxZ);
   renderer.setRenderBoundsFromBlock(block);
   tessellator.startDrawingQuads();
   tessellator.setNormal(0.0F, -1F, 0.0F);
   renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, icon);
   tessellator.draw();
   tessellator.startDrawingQuads();
   tessellator.setNormal(0.0F, 1.0F, 0.0F);
   renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, icon);
   tessellator.draw();
   tessellator.startDrawingQuads();
   tessellator.setNormal(0.0F, 0.0F, -1F);
   renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, icon);
   tessellator.draw();
   tessellator.startDrawingQuads();
   tessellator.setNormal(0.0F, 0.0F, 1.0F);
   renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, icon);
   tessellator.draw();
   tessellator.startDrawingQuads();
   tessellator.setNormal(-1F, 0.0F, 0.0F);
   renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, icon);
   tessellator.draw();
   tessellator.startDrawingQuads();
   tessellator.setNormal(1.0F, 0.0F, 0.0F);
   renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, icon);
   tessellator.draw();
   GL11.glTranslatef(0.5F, 0.5F, 0.5F);
   block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
   renderer.setRenderBoundsFromBlock(block);
 }
  private void renderSideAtOrigin(
      BlockThinLogFence block,
      int metadata,
      RenderBlocks renderer,
      Tessellator tessellator,
      float xs,
      float xe) {
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 0.0F, -1.0F);
    renderer.setRenderBounds(xs, 0, 0, xe, 1, 1);
    renderer.renderFaceZNeg(block, 0, 0, .5f, block.getSideIcon());
    tessellator.draw();

    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 0.0F, 1.0F);
    renderer.setRenderBounds(xs, 0, 0, xe, 1, 1);
    renderer.renderFaceZPos(block, 0, 0, -.5f, block.getSideIcon());
    tessellator.draw();
  }
  @Override
  public void renderInventoryBlock(Block b, int metadata, int modelId, RenderBlocks rb) {
    Tessellator v5 = Tessellator.instance;

    rb.renderMaxX = 1;
    rb.renderMinY = 0;
    rb.renderMaxZ = 1;
    rb.renderMinX = 0;
    rb.renderMinZ = 0;
    rb.renderMaxY = 1;

    GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
    GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
    v5.startDrawingQuads();
    v5.setNormal(0.0F, -1.0F, 0.0F);
    rb.renderFaceYNeg(b, 0.0D, 0.0D, 0.0D, b.getIcon(0, metadata));
    v5.draw();

    v5.startDrawingQuads();
    v5.setNormal(0.0F, 1.0F, 0.0F);
    rb.renderFaceYPos(b, 0.0D, 0.0D, 0.0D, b.getIcon(1, metadata));
    v5.draw();

    v5.startDrawingQuads();
    v5.setNormal(0.0F, 0.0F, -1.0F);
    rb.renderFaceZNeg(b, 0.0D, 0.0D, 0.0D, b.getIcon(2, metadata));
    v5.draw();
    v5.startDrawingQuads();
    v5.setNormal(0.0F, 0.0F, 1.0F);
    rb.renderFaceZPos(b, 0.0D, 0.0D, 0.0D, b.getIcon(3, metadata));
    v5.draw();
    v5.startDrawingQuads();
    v5.setNormal(-1.0F, 0.0F, 0.0F);
    rb.renderFaceXNeg(b, 0.0D, 0.0D, 0.0D, b.getIcon(4, metadata));
    v5.draw();
    v5.startDrawingQuads();
    v5.setNormal(1.0F, 0.0F, 0.0F);
    rb.renderFaceXPos(b, 0.0D, 0.0D, 0.0D, b.getIcon(5, metadata));
    v5.draw();

    GL11.glTranslatef(0.5F, 0.5F, 0.5F);
  }
 @Override
 public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
   int meta = 3;
   if (block == Evercraft_Blocks.blockplatemillOn) meta = 1;
   Tessellator tessellator = Tessellator.instance;
   block.setBlockBoundsForItemRender();
   renderer.setRenderBoundsFromBlock(block);
   GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
   GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
   tessellator.startDrawingQuads();
   tessellator.setNormal(0.0F, -1.0F, 0.0F);
   renderer.renderFaceYNeg(
       block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
   tessellator.draw();
   tessellator.startDrawingQuads();
   tessellator.setNormal(0.0F, 1.0F, 0.0F);
   renderer.renderFaceYPos(
       block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));
   tessellator.draw();
   tessellator.startDrawingQuads();
   tessellator.setNormal(0.0F, 0.0F, -1.0F);
   renderer.renderFaceZNeg(
       block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 2, meta));
   tessellator.draw();
   tessellator.startDrawingQuads();
   tessellator.setNormal(0.0F, 0.0F, 1.0F);
   renderer.renderFaceZPos(
       block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 3, meta));
   tessellator.draw();
   tessellator.startDrawingQuads();
   tessellator.setNormal(-1.0F, 0.0F, 0.0F);
   renderer.renderFaceXNeg(
       block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 4, meta));
   tessellator.draw();
   tessellator.startDrawingQuads();
   tessellator.setNormal(1.0F, 0.0F, 0.0F);
   renderer.renderFaceXPos(
       block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 5, meta));
   tessellator.draw();
   GL11.glTranslatef(0.5F, 0.5F, 0.5F);
 }
Ejemplo n.º 23
0
  @Override
  public boolean renderWorldBlock(
      IBlockAccess world, int x, int y, int z, Block b, int modelId, RenderBlocks rb) {
    Tessellator v5 = Tessellator.instance;
    int meta = world.getBlockMetadata(x, y, z);

    BlockTieredOre t = (BlockTieredOre) b;
    if (t.isPlayerSufficientTier(world, x, y, z, Minecraft.getMinecraft().thePlayer)) {
      if (TieredOres.list[meta].renderAsGeode()) {
        this.renderGeode(world, x, y, z, b, meta, rb);
        // this.renderSimpleGeode(world, x, y, z, b, meta, rb);
      } else {
        rb.renderStandardBlockWithAmbientOcclusion(b, x, y, z, 1, 1, 1);

        IIcon ico = t.getOverlay(meta);
        v5.setBrightness(240);
        v5.setColorOpaque(255, 255, 255);
        if (b.shouldSideBeRendered(world, x, y - 1, z, ForgeDirection.DOWN.ordinal()))
          rb.renderFaceYNeg(b, x, y, z, ico);
        if (b.shouldSideBeRendered(world, x, y + 1, z, ForgeDirection.UP.ordinal()))
          rb.renderFaceYPos(b, x, y, z, ico);
        if (b.shouldSideBeRendered(world, x, y, z - 1, ForgeDirection.NORTH.ordinal()))
          rb.renderFaceZNeg(b, x, y, z, ico);
        if (b.shouldSideBeRendered(world, x, y, z + 1, ForgeDirection.SOUTH.ordinal()))
          rb.renderFaceZPos(b, x, y, z, ico);
        if (b.shouldSideBeRendered(world, x - 1, y, z, ForgeDirection.WEST.ordinal()))
          rb.renderFaceXNeg(b, x, y, z, ico);
        if (b.shouldSideBeRendered(world, x + 1, y, z, ForgeDirection.EAST.ordinal()))
          rb.renderFaceXPos(b, x, y, z, ico);
      }
    } else {
      rb.renderBlockAllFaces(t.getDisguise(meta), x, y, z);
      // rb.renderStandardBlockWithAmbientOcclusion(t.getDisguise(), x, y, z, 1, 1, 1);
    }
    return true;
  }
  @Override
  public void renderInventoryBlock(Block b, int metadata, int modelId, RenderBlocks rb) {
    Tessellator v5 = Tessellator.instance;

    rb.renderMaxX = 1;
    rb.renderMinY = 0;
    rb.renderMaxZ = 1;
    rb.renderMinX = 0;
    rb.renderMinZ = 0;
    rb.renderMaxY = 1;

    GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
    GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
    v5.startDrawingQuads();
    v5.setNormal(0.0F, -1.0F, 0.0F);
    rb.renderFaceYNeg(b, 0.0D, 0.0D, 0.0D, b.getIcon(0, metadata));
    v5.draw();

    v5.startDrawingQuads();
    v5.setNormal(0.0F, 1.0F, 0.0F);
    rb.renderFaceYPos(b, 0.0D, 0.0D, 0.0D, b.getIcon(1, metadata));
    v5.draw();

    v5.startDrawingQuads();
    v5.setNormal(0.0F, 0.0F, -1.0F);
    rb.renderFaceZNeg(b, 0.0D, 0.0D, 0.0D, b.getIcon(2, metadata));
    v5.draw();
    v5.startDrawingQuads();
    v5.setNormal(0.0F, 0.0F, 1.0F);
    rb.renderFaceZPos(b, 0.0D, 0.0D, 0.0D, b.getIcon(3, metadata));
    v5.draw();
    v5.startDrawingQuads();
    v5.setNormal(-1.0F, 0.0F, 0.0F);
    rb.renderFaceXNeg(b, 0.0D, 0.0D, 0.0D, b.getIcon(4, metadata));
    v5.draw();
    v5.startDrawingQuads();
    v5.setNormal(1.0F, 0.0F, 0.0F);
    rb.renderFaceXPos(b, 0.0D, 0.0D, 0.0D, b.getIcon(5, metadata));
    v5.draw();

    LightedTreeBlock ltb = (LightedTreeBlock) b;
    IIcon ico = ltb.getOverlay(metadata);
    if (ltb.renderOverlayOnSide(0, metadata)) {
      v5.startDrawingQuads();
      v5.setColorOpaque_I(0xffffff);
      v5.setBrightness(240);
      v5.setNormal(0.0F, -1.0F, 0.0F);
      rb.renderFaceYNeg(b, 0.0D, 0.0D, 0.0D, ico);
      v5.draw();
    }

    if (ltb.renderOverlayOnSide(1, metadata)) {
      v5.startDrawingQuads();
      v5.setColorOpaque_I(0xffffff);
      v5.setBrightness(240);
      v5.setNormal(0.0F, 1.0F, 0.0F);
      rb.renderFaceYPos(b, 0.0D, 0.0D, 0.0D, ico);
      v5.draw();
    }

    if (ltb.renderOverlayOnSide(2, metadata)) {
      v5.startDrawingQuads();
      v5.setColorOpaque_I(0xffffff);
      v5.setBrightness(240);
      v5.setNormal(0.0F, 0.0F, -1.0F);
      rb.renderFaceZNeg(b, 0.0D, 0.0D, 0.0D, ico);
      v5.draw();
    }

    if (ltb.renderOverlayOnSide(3, metadata)) {
      v5.startDrawingQuads();
      v5.setColorOpaque_I(0xffffff);
      v5.setBrightness(240);
      v5.setNormal(0.0F, 0.0F, 1.0F);
      rb.renderFaceZPos(b, 0.0D, 0.0D, 0.0D, ico);
      v5.draw();
    }

    if (ltb.renderOverlayOnSide(4, metadata)) {
      v5.startDrawingQuads();
      v5.setColorOpaque_I(0xffffff);
      v5.setBrightness(240);
      v5.setNormal(-1.0F, 0.0F, 0.0F);
      rb.renderFaceXNeg(b, 0.0D, 0.0D, 0.0D, ico);
      v5.draw();
    }

    if (ltb.renderOverlayOnSide(5, metadata)) {
      v5.startDrawingQuads();
      v5.setColorOpaque_I(0xffffff);
      v5.setBrightness(240);
      v5.setNormal(1.0F, 0.0F, 0.0F);
      rb.renderFaceXPos(b, 0.0D, 0.0D, 0.0D, ico);
      v5.draw();
    }

    GL11.glTranslatef(0.5F, 0.5F, 0.5F);
  }
Ejemplo n.º 25
0
  public static void renderInventoryCubes(
      RenderBlocks renderer, ArrayList<CubeObject> cubes, Block parBlock, int meta) {
    Tessellator tesselator = Tessellator.instance;
    for (int i = 0; i < cubes.size(); i++) {
      /* if (block.getRenderBlockPass() != 0)
      {
          GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
          GL11.glEnable(GL11.GL_BLEND);
          OpenGlHelper.glBlendFunc(770, 771, 1, 0);
      }
      else
      {
          GL11.glAlphaFunc(GL11.GL_GREATER, 0.5F);
          GL11.glDisable(GL11.GL_BLEND);
      }*/
      int metadata = 0;
      if (cubes.get(i).meta != -1) metadata = cubes.get(i).meta;
      Block block = parBlock;
      if (block instanceof BlockAir) block = Blocks.stone;
      renderer.setRenderBounds(
          cubes.get(i).minX,
          cubes.get(i).minY,
          cubes.get(i).minZ,
          cubes.get(i).maxX,
          cubes.get(i).maxY,
          cubes.get(i).maxZ);
      if (cubes.get(i).block != null && !(cubes.get(i).block instanceof BlockAir)) {
        block = cubes.get(i).block;
        meta = 0;
      }
      if (cubes.get(i).icon != null) {
        GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
        tesselator.startDrawingQuads();
        tesselator.setNormal(0.0F, -1.0F, 0.0F);
        renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, cubes.get(i).icon);
        tesselator.draw();
        tesselator.startDrawingQuads();
        tesselator.setNormal(0.0F, 1.0F, 0.0F);
        renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, cubes.get(i).icon);
        tesselator.draw();
        tesselator.startDrawingQuads();
        tesselator.setNormal(0.0F, 0.0F, -1.0F);
        renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, cubes.get(i).icon);
        tesselator.draw();
        tesselator.startDrawingQuads();
        tesselator.setNormal(0.0F, 0.0F, 1.0F);
        renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, cubes.get(i).icon);
        tesselator.draw();
        tesselator.startDrawingQuads();
        tesselator.setNormal(-1.0F, 0.0F, 0.0F);
        renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, cubes.get(i).icon);
        tesselator.draw();
        tesselator.startDrawingQuads();
        tesselator.setNormal(1.0F, 0.0F, 0.0F);
        renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, cubes.get(i).icon);
        tesselator.draw();
        GL11.glTranslatef(0.5F, 0.5F, 0.5F);
      } else {
        int j = block.getRenderColor(metadata);
        if (cubes.get(i).color != ColorUtils.WHITE) j = cubes.get(i).color;
        /*boolean defaultColor = cubes.get(i).;
        if (defaultColor)
        {
            j = 16777215;
        }*/

        float f1 = (float) (j >> 16 & 255) / 255.0F;
        float f2 = (float) (j >> 8 & 255) / 255.0F;
        float f3 = (float) (j & 255) / 255.0F;
        float brightness = 1.0F;
        GL11.glColor4f(f1 * brightness, f2 * brightness, f3 * brightness, 1.0F);

        GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
        tesselator.startDrawingQuads();
        tesselator.setNormal(0.0F, -1.0F, 0.0F);
        renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, metadata));
        tesselator.draw();
        tesselator.startDrawingQuads();
        tesselator.setNormal(0.0F, 1.0F, 0.0F);
        renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, metadata));
        tesselator.draw();
        tesselator.startDrawingQuads();
        tesselator.setNormal(0.0F, 0.0F, -1.0F);
        renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, metadata));
        tesselator.draw();
        tesselator.startDrawingQuads();
        tesselator.setNormal(0.0F, 0.0F, 1.0F);
        renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(3, metadata));
        tesselator.draw();
        tesselator.startDrawingQuads();
        tesselator.setNormal(-1.0F, 0.0F, 0.0F);
        renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(4, metadata));
        tesselator.draw();
        tesselator.startDrawingQuads();
        tesselator.setNormal(1.0F, 0.0F, 0.0F);
        renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, metadata));
        tesselator.draw();
        GL11.glTranslatef(0.5F, 0.5F, 0.5F);
      }
    }
  }
  @Override
  public boolean renderWorldBlock(
      IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
    int metadata = world.getBlockMetadata(x, y, z);
    if (renderPass == 0
        || metadata == BlockMetalDevices2.META_floodlight
        || metadata == BlockMetalDevices2.META_chargingStation)
      if (metadata == BlockMetalDevices2.META_breakerSwitch) {
        TileEntityBreakerSwitch tile = (TileEntityBreakerSwitch) world.getTileEntity(x, y, z);
        ClientUtils.handleStaticTileRenderer(tile);
        ClientUtils.renderAttachedConnections(tile);
        return true;
      } else if (metadata == BlockMetalDevices2.META_skycrateDispenser) {
        renderer.setRenderBounds(0, 0, 0, 1, 1, 1);
        return renderer.renderStandardBlock(block, x, y, z);
      } else if (metadata == BlockMetalDevices2.META_energyMeter) {
        TileEntityEnergyMeter tile = (TileEntityEnergyMeter) world.getTileEntity(x, y, z);
        if (!tile.dummy) {
          ClientUtils.handleStaticTileRenderer(tile);
          ClientUtils.renderAttachedConnections(tile);
          return true;
        }
      } else if (metadata == BlockMetalDevices2.META_electricLantern) {
        TileEntityElectricLantern tile = (TileEntityElectricLantern) world.getTileEntity(x, y, z);
        ClientUtils.handleStaticTileRenderer(tile);
        ClientUtils.renderAttachedConnections(tile);
        return true;
      } else if (metadata == BlockMetalDevices2.META_floodlight) {
        TileEntityFloodlight tile = (TileEntityFloodlight) world.getTileEntity(x, y, z);
        ClientUtils.handleStaticTileRenderer(tile);
        ClientUtils.renderAttachedConnections(tile);
        return true;
      } else if (metadata == BlockMetalDevices2.META_fluidPipe) {
        TileEntityFluidPipe tile = (TileEntityFluidPipe) world.getTileEntity(x, y, z);
        ClientUtils.handleStaticTileRenderer(tile);
        if (tile.scaffoldCovering != null) {
          Block cover = Block.getBlockFromItem(tile.scaffoldCovering.getItem());
          float f = .015625f;
          AxisAlignedBB aabb =
              AxisAlignedBB.getBoundingBox(1 - f, 1 - f, 1 - f, f, f, f)
                  .getOffsetBoundingBox(x, y, z);
          ClientUtils.drawWorldBlock(world, cover, x, y, z, tile.scaffoldCovering.getItemDamage());
          ClientUtils.drawWorldBlock(
              world, cover, x, y, z, tile.scaffoldCovering.getItemDamage(), aabb);
        }
        return true;
      } else if (metadata == BlockMetalDevices2.META_fluidPump) {
        TileEntityFluidPump tile = (TileEntityFluidPump) world.getTileEntity(x, y, z);
        if (!tile.dummy) {
          ClientUtils.handleStaticTileRenderer(tile);
          renderer.renderFaceXPos(
              IEContent.blockMetalDevice2,
              x,
              y,
              z,
              IEContent.blockMetalDevice2.getIcon(
                  tile.sideConfig[5], BlockMetalDevices2.META_fluidPump));
          renderer.renderFaceXNeg(
              IEContent.blockMetalDevice2,
              x,
              y,
              z,
              IEContent.blockMetalDevice2.getIcon(
                  tile.sideConfig[4], BlockMetalDevices2.META_fluidPump));
          renderer.renderFaceZPos(
              IEContent.blockMetalDevice2,
              x,
              y,
              z,
              IEContent.blockMetalDevice2.getIcon(
                  tile.sideConfig[3], BlockMetalDevices2.META_fluidPump));
          renderer.renderFaceZNeg(
              IEContent.blockMetalDevice2,
              x,
              y,
              z,
              IEContent.blockMetalDevice2.getIcon(
                  tile.sideConfig[2], BlockMetalDevices2.META_fluidPump));
          renderer.renderFaceYNeg(
              IEContent.blockMetalDevice2,
              x,
              y,
              z,
              IEContent.blockMetalDevice2.getIcon(
                  3 + tile.sideConfig[0], BlockMetalDevices2.META_fluidPump));
        }

        return true;
      } else if (metadata == BlockMetalDevices2.META_barrel) {
        renderer.setRenderBoundsFromBlock(block);
        return renderer.renderStandardBlock(block, x, y, z);
      } else if (metadata == BlockMetalDevices2.META_capacitorCreative) {
        renderer.setRenderBounds(0, 0, 0, 1, 1, 1);
        return renderer.renderStandardBlock(block, x, y, z);
      } else if (metadata == BlockMetalDevices2.META_redstoneBreaker) {
        TileEntityRedstoneBreaker tile = (TileEntityRedstoneBreaker) world.getTileEntity(x, y, z);
        ClientUtils.handleStaticTileRenderer(tile);
        ClientUtils.renderAttachedConnections(tile);
        return true;
      } else if (metadata == BlockMetalDevices2.META_chargingStation) {
        TileEntityChargingStation tile = (TileEntityChargingStation) world.getTileEntity(x, y, z);
        ClientUtils.handleStaticTileRenderer(tile);
        return true;
      }
    return false;
  }
  @Override
  public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
    GL11.glPushMatrix();
    try {
      if (metadata == BlockMetalDevices2.META_breakerSwitch) {
        GL11.glTranslatef(-1f, -.75f, .25f);
        GL11.glScalef(1.25f, 1.25f, 1.25f);
        GL11.glRotatef(-90, 1, 0, 0);
        Tessellator.instance.startDrawingQuads();
        ClientUtils.handleStaticTileRenderer(new TileEntityBreakerSwitch());
        Tessellator.instance.draw();
      } else if (metadata == BlockMetalDevices2.META_energyMeter) {
        GL11.glScalef(.75f, .75f, .75f);
        GL11.glTranslatef(0, .625f, 0);
        Tessellator.instance.startDrawingQuads();
        ClientUtils.handleStaticTileRenderer(new TileEntityEnergyMeter());
        Tessellator.instance.draw();
      } else if (metadata == BlockMetalDevices2.META_electricLantern) {
        Tessellator.instance.startDrawingQuads();
        ClientUtils.handleStaticTileRenderer(new TileEntityElectricLantern());
        Tessellator.instance.draw();
      } else if (metadata == BlockMetalDevices2.META_floodlight) {
        Tessellator.instance.startDrawingQuads();
        TileEntityFloodlight tile = new TileEntityFloodlight();
        TileEntitySpecialRenderer tesr =
            TileEntityRendererDispatcher.instance.getSpecialRenderer(tile);
        if (tesr instanceof TileRenderFloodlight)
          ((TileRenderFloodlight) tesr)
              .model.render(
                  tile,
                  Tessellator.instance,
                  new Matrix4().translate(0, .125, 0),
                  new Matrix4().rotate(Math.PI, 0, 1, 0),
                  0,
                  false);
        Tessellator.instance.draw();
      } else if (metadata == BlockMetalDevices2.META_fluidPipe) {
        Tessellator.instance.startDrawingQuads();
        ClientUtils.handleStaticTileRenderer(new TileEntityFluidPipe());
        Tessellator.instance.draw();
      } else if (metadata == BlockMetalDevices2.META_fluidPump) {
        GL11.glPushMatrix();
        GL11.glScalef(0.65f, 0.65f, 0.65f);
        GL11.glTranslatef(0, -0.5f, 0);
        IEContent.blockMetalDevice2.setBlockBounds(0, 0, 0, 1, 1, 1);
        renderer.setRenderBoundsFromBlock(IEContent.blockMetalDevice2);
        Tessellator.instance.startDrawingQuads();
        Tessellator.instance.setNormal(1.0F, 0.0F, 0.0F);
        renderer.renderFaceXPos(
            IEContent.blockMetalDevice2,
            0,
            0,
            0,
            IEContent.blockMetalDevice2.getIcon(0, BlockMetalDevices2.META_fluidPump));
        Tessellator.instance.draw();

        Tessellator.instance.startDrawingQuads();
        Tessellator.instance.setNormal(-1.0F, 0.0F, 0.0F);
        renderer.renderFaceXNeg(
            IEContent.blockMetalDevice2,
            0,
            0,
            0,
            IEContent.blockMetalDevice2.getIcon(2, BlockMetalDevices2.META_fluidPump));
        Tessellator.instance.draw();

        Tessellator.instance.startDrawingQuads();
        Tessellator.instance.setNormal(0.0F, 0.0F, 1.0F);
        renderer.renderFaceZPos(
            IEContent.blockMetalDevice2,
            0,
            0,
            0,
            IEContent.blockMetalDevice2.getIcon(1, BlockMetalDevices2.META_fluidPump));
        Tessellator.instance.draw();

        Tessellator.instance.startDrawingQuads();
        Tessellator.instance.setNormal(0.0F, 0.0F, -1.0F);
        renderer.renderFaceZNeg(
            IEContent.blockMetalDevice2,
            0,
            0,
            0,
            IEContent.blockMetalDevice2.getIcon(0, BlockMetalDevices2.META_fluidPump));
        Tessellator.instance.draw();

        Tessellator.instance.startDrawingQuads();
        Tessellator.instance.setNormal(0.0F, -1.0f, 0.0F);
        renderer.renderFaceYNeg(
            IEContent.blockMetalDevice2,
            0,
            0,
            0,
            IEContent.blockMetalDevice2.getIcon(3, BlockMetalDevices2.META_fluidPump));
        Tessellator.instance.draw();

        Tessellator.instance.startDrawingQuads();
        ClientUtils.handleStaticTileRenderer(new TileEntityFluidPump());
        Tessellator.instance.draw();
        GL11.glPopMatrix();
      } else if (metadata == BlockMetalDevices2.META_barrel) {
        renderer.setRenderBounds(0, 0, 0, 1, 1, 1);
        ClientUtils.drawInventoryBlock(block, metadata, renderer);
      } else if (metadata == BlockMetalDevices2.META_capacitorCreative) {
        block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
        renderer.setRenderBoundsFromBlock(block);
        ClientUtils.drawInventoryBlock(block, metadata, renderer);
      } else if (metadata == BlockMetalDevices2.META_redstoneBreaker) {
        GL11.glTranslatef(-.5f, -.5f, -.5f);
        Tessellator.instance.startDrawingQuads();
        ClientUtils.handleStaticTileRenderer(new TileEntityRedstoneBreaker());
        Tessellator.instance.draw();
      } else if (metadata == BlockMetalDevices2.META_chargingStation) {
        Tessellator.instance.startDrawingQuads();
        TileEntityChargingStation tile = new TileEntityChargingStation();
        GL11.glRotatef(-180, 0, 1, 0);
        GL11.glTranslatef(-.5f, -.5f, -.5f);
        renderPass = 0;
        ClientUtils.handleStaticTileRenderer(tile);
        renderPass = 1;
        ClientUtils.handleStaticTileRenderer(tile);
        Tessellator.instance.draw();
      }

    } catch (Exception e) {
      e.printStackTrace();
    }
    GL11.glPopMatrix();
  }
Ejemplo n.º 28
0
  @Override
  public void renderInventoryBlock(Block b, int metadata, int modelId, RenderBlocks rb) {
    BlockTieredOre bt = (BlockTieredOre) b;
    Tessellator v5 = Tessellator.instance;

    rb.renderMaxX = 1;
    rb.renderMinY = 0;
    rb.renderMaxZ = 1;
    rb.renderMinX = 0;
    rb.renderMinZ = 0;
    rb.renderMaxY = 1;

    boolean tier =
        bt.getProgressStage(metadata).isPlayerAtStage(Minecraft.getMinecraft().thePlayer);
    IIcon ico = tier ? bt.getBacking(metadata) : bt.getDisguise(metadata).getIcon(0, 0);

    if (!tier || !TieredOres.list[metadata].renderAsGeode()) {
      GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
      GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
      v5.startDrawingQuads();
      v5.setNormal(0.0F, -1.0F, 0.0F);
      rb.renderFaceYNeg(b, 0.0D, 0.0D, 0.0D, ico);
      v5.draw();

      v5.startDrawingQuads();
      v5.setNormal(0.0F, 1.0F, 0.0F);
      rb.renderFaceYPos(b, 0.0D, 0.0D, 0.0D, ico);
      v5.draw();

      v5.startDrawingQuads();
      v5.setNormal(0.0F, 0.0F, -1.0F);
      rb.renderFaceZNeg(b, 0.0D, 0.0D, 0.0D, ico);
      v5.draw();
      v5.startDrawingQuads();
      v5.setNormal(0.0F, 0.0F, 1.0F);
      rb.renderFaceZPos(b, 0.0D, 0.0D, 0.0D, ico);
      v5.draw();
      v5.startDrawingQuads();
      v5.setNormal(-1.0F, 0.0F, 0.0F);
      rb.renderFaceXNeg(b, 0.0D, 0.0D, 0.0D, ico);
      v5.draw();
      v5.startDrawingQuads();
      v5.setNormal(1.0F, 0.0F, 0.0F);
      rb.renderFaceXPos(b, 0.0D, 0.0D, 0.0D, ico);
      v5.draw();
    }

    if (tier) {
      if (TieredOres.list[metadata].renderAsGeode()) {
        GL11.glPushMatrix();
        GL11.glTranslated(-0.5, -0.5, -0.5);
        v5.startDrawingQuads();
        this.renderGeode(null, 0, 0, 0, bt, metadata, rb);
        v5.draw();
        GL11.glPopMatrix();
      } else {
        ico = ((BlockTieredOre) b).getOverlay(metadata);
        v5.startDrawingQuads();
        v5.setNormal(0.0F, -1.0F, 0.0F);
        rb.renderFaceYNeg(b, 0.0D, 0.0D, 0.0D, ico);
        v5.draw();

        v5.startDrawingQuads();
        v5.setNormal(0.0F, 1.0F, 0.0F);
        rb.renderFaceYPos(b, 0.0D, 0.0D, 0.0D, ico);
        v5.draw();

        v5.startDrawingQuads();
        v5.setNormal(0.0F, 0.0F, -1.0F);
        rb.renderFaceZNeg(b, 0.0D, 0.0D, 0.0D, ico);
        v5.draw();
        v5.startDrawingQuads();
        v5.setNormal(0.0F, 0.0F, 1.0F);
        rb.renderFaceZPos(b, 0.0D, 0.0D, 0.0D, ico);
        v5.draw();
        v5.startDrawingQuads();
        v5.setNormal(-1.0F, 0.0F, 0.0F);
        rb.renderFaceXNeg(b, 0.0D, 0.0D, 0.0D, ico);
        v5.draw();
        v5.startDrawingQuads();
        v5.setNormal(1.0F, 0.0F, 0.0F);
        rb.renderFaceXPos(b, 0.0D, 0.0D, 0.0D, ico);
        v5.draw();
      }
    }

    GL11.glTranslatef(0.5F, 0.5F, 0.5F);
  }
Ejemplo n.º 29
0
  @Override
  public void renderInventoryBlock(Block b, int metadata, int modelId, RenderBlocks rb) {
    Tessellator tessellator = Tessellator.instance;

    rb.renderMaxX = 1;
    rb.renderMinY = 0;
    rb.renderMaxZ = 1;
    rb.renderMinX = 0;
    rb.renderMinZ = 0;
    rb.renderMaxY = 1;

    IIcon ico = b.getIcon(0, metadata);

    GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
    GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, -1.0F, 0.0F);
    rb.renderFaceYNeg(b, 0.0D, 0.0D, 0.0D, ico);
    tessellator.draw();

    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 1.0F, 0.0F);
    rb.renderFaceYPos(b, 0.0D, 0.0D, 0.0D, ico);
    tessellator.draw();

    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 0.0F, -1.0F);
    rb.renderFaceZNeg(b, 0.0D, 0.0D, 0.0D, ico);
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 0.0F, 1.0F);
    rb.renderFaceZPos(b, 0.0D, 0.0D, 0.0D, ico);
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(-1.0F, 0.0F, 0.0F);
    rb.renderFaceXNeg(b, 0.0D, 0.0D, 0.0D, ico);
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(1.0F, 0.0F, 0.0F);
    rb.renderFaceXPos(b, 0.0D, 0.0D, 0.0D, ico);
    tessellator.draw();

    ico = CrystalElement.elements[metadata].getFaceRune();
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, -1.0F, 0.0F);
    rb.renderFaceYNeg(b, 0.0D, 0.0D, 0.0D, ico);
    tessellator.draw();

    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 1.0F, 0.0F);
    rb.renderFaceYPos(b, 0.0D, 0.0D, 0.0D, ico);
    tessellator.draw();

    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 0.0F, -1.0F);
    rb.renderFaceZNeg(b, 0.0D, 0.0D, 0.0D, ico);
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 0.0F, 1.0F);
    rb.renderFaceZPos(b, 0.0D, 0.0D, 0.0D, ico);
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(-1.0F, 0.0F, 0.0F);
    rb.renderFaceXNeg(b, 0.0D, 0.0D, 0.0D, ico);
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(1.0F, 0.0F, 0.0F);
    rb.renderFaceXPos(b, 0.0D, 0.0D, 0.0D, ico);
    tessellator.draw();

    GL11.glTranslatef(0.5F, 0.5F, 0.5F);
  }
  @Override
  public boolean renderWorldBlock(
      IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
    if (modelId == RENDER_ID) {
      final BlockBrewKettle brewKettle = (BlockBrewKettle) block;
      final double d = 0.0625D;
      float f = 1.0F;
      renderer.renderStandardBlock(block, x, y, z);
      final Tessellator tes = Tessellator.instance;
      tes.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
      int color = block.colorMultiplier(world, x, y, z);
      float r = (float) (color >> 16 & 255) / 255.0F;
      float g = (float) (color >> 8 & 255) / 255.0F;
      float b = (float) (color & 255) / 255.0F;
      float f4;

      if (EntityRenderer.anaglyphEnable) {
        final float f5 = (r * 30.0F + g * 59.0F + b * 11.0F) / 100.0F;
        f4 = (r * 30.0F + g * 70.0F) / 100.0F;
        final float f6 = (r * 30.0F + b * 70.0F) / 100.0F;
        r = f5;
        g = f4;
        b = f6;
      }

      tes.setColorOpaque_F(f * r, f * g, f * b);
      f4 = 0.125F;
      renderer.renderFaceXPos(
          block, (double) (x - 1.0F + f4), (double) y, (double) z, brewKettle.getIconByIndex(2));
      renderer.renderFaceXNeg(
          block, (double) (x + 1.0F - f4), (double) y, (double) z, brewKettle.getIconByIndex(2));
      renderer.renderFaceZPos(
          block, (double) x, (double) y, (double) (z - 1.0F + f4), brewKettle.getIconByIndex(2));
      renderer.renderFaceZNeg(
          block, (double) x, (double) y, (double) (z + 1.0F - f4), brewKettle.getIconByIndex(2));
      renderer.renderFaceYPos(
          block, (double) x, (double) (y - 1.0F + 0.25F), (double) z, brewKettle.getIconByIndex(1));
      renderer.renderFaceYNeg(
          block, (double) x, (double) (y + 1.0F - 0.75F), (double) z, brewKettle.getIconByIndex(1));

      // Render Liquid
      final TileEntityBrewKettle te = (TileEntityBrewKettle) world.getTileEntity(x, y, z);
      if (te != null) {
        for (int i = 0; i < 2; ++i) {
          if (te.isFluidTankFilled(i)) {
            final Fluid fluid = te.getFluid(i);
            color = fluid.getColor();
            r = (float) (color >> 16 & 255) / 255.0F;
            g = (float) (color >> 8 & 255) / 255.0F;
            b = (float) (color & 255) / 255.0F;
            f = 1.0F;
            tes.setColorOpaque_F(f * r, f * g, f * b);
            f = te.getFluidAmount(i) * FLUID_HEIGHT / te.getFluidTank(i).getCapacity();
            renderer.setRenderBounds(2 * d, 0.0D, 2 * d, 14 * d, (double) (0.25F + f), 14 * d);
            renderer.renderFaceYPos(block, (double) x, (double) y, (double) z, fluid.getIcon());
          }
        }
      }

      renderer.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D);
    }
    return true;
  }