@Override
  public void renderTileEntityAt(TileEntity t, double x, double y, double z, float pt) {
    Block blockType = t.getBlockType();

    Tessellator tes = Tessellator.instance;
    tes.setColorOpaque_F(1.0F, 1.0F, 1.0F);

    renderBlocks.blockAccess = t.getWorldObj();

    {
      if (Minecraft.isAmbientOcclusionEnabled()) {
        GL11.glShadeModel(GL11.GL_SMOOTH);
      } else {
        GL11.glShadeModel(GL11.GL_FLAT);
      }
      RenderHelper.disableStandardItemLighting();

      RenderUtils.loadTexture(TextureMap.locationBlocksTexture);

      tes.startDrawingQuads();
      tes.setTranslation(x - t.xCoord, y - t.yCoord, z - t.zCoord);

      renderBlocks.renderBlockAllFaces(blockType, t.xCoord, t.yCoord, t.zCoord);
      tes.setTranslation(0, 0, 0);
      tes.draw();

      RenderHelper.enableStandardItemLighting();
    }
  }
示例#2
0
  private void renderHandles(PedestalTileEntity te) {
    GlStateManager.pushMatrix();

    GlStateManager.translate(.5, 0, .5);
    long angle = (System.currentTimeMillis() / 10) % 360;
    GlStateManager.rotate(angle, 0, 1, 0);

    RenderHelper.disableStandardItemLighting();
    this.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    if (Minecraft.isAmbientOcclusionEnabled()) {
      GlStateManager.shadeModel(GL11.GL_SMOOTH);
    } else {
      GlStateManager.shadeModel(GL11.GL_FLAT);
    }

    World world = te.getWorld();
    // Translate back to local view coordinates so that we can do the acual rendering here
    GlStateManager.translate(-te.getPos().getX(), -te.getPos().getY(), -te.getPos().getZ());

    Tessellator tessellator = Tessellator.getInstance();
    tessellator.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK);
    Minecraft.getMinecraft()
        .getBlockRendererDispatcher()
        .getBlockModelRenderer()
        .renderModel(
            world,
            getBakedModel(),
            world.getBlockState(te.getPos()),
            te.getPos(),
            Tessellator.getInstance().getBuffer(),
            false);
    tessellator.draw();

    RenderHelper.enableStandardItemLighting();
    GlStateManager.popMatrix();
  }
  public void renderPiston(
      TileEntityPiston par1TileEntityPiston, double par2, double par4, double par6, float par8) {
    Block var9 = Block.blocksList[par1TileEntityPiston.getStoredBlockID()];

    if (var9 != null && par1TileEntityPiston.getProgress(par8) < 1.0F) {
      Tessellator var10 = Tessellator.instance;
      this.bindTextureByName("/terrain.png");
      RenderHelper.disableStandardItemLighting();
      GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
      GL11.glEnable(GL11.GL_BLEND);
      GL11.glDisable(GL11.GL_CULL_FACE);

      if (Minecraft.isAmbientOcclusionEnabled()) {
        GL11.glShadeModel(GL11.GL_SMOOTH);
      } else {
        GL11.glShadeModel(GL11.GL_FLAT);
      }

      ForgeHooksClient.beforeBlockRender(var9, blockRenderer);
      var10.startDrawingQuads();
      var10.setTranslation(
          (double)
              ((float) par2
                  - (float) par1TileEntityPiston.xCoord
                  + par1TileEntityPiston.getOffsetX(par8)),
          (double)
              ((float) par4
                  - (float) par1TileEntityPiston.yCoord
                  + par1TileEntityPiston.getOffsetY(par8)),
          (double)
              ((float) par6
                  - (float) par1TileEntityPiston.zCoord
                  + par1TileEntityPiston.getOffsetZ(par8)));
      var10.setColorOpaque(1, 1, 1);

      if (var9 == Block.pistonExtension && par1TileEntityPiston.getProgress(par8) < 0.5F) {
        this.blockRenderer.renderPistonExtensionAllFaces(
            var9,
            par1TileEntityPiston.xCoord,
            par1TileEntityPiston.yCoord,
            par1TileEntityPiston.zCoord,
            false);
      } else if (par1TileEntityPiston.shouldRenderHead() && !par1TileEntityPiston.isExtending()) {
        Block.pistonExtension.setHeadTexture(((BlockPistonBase) var9).getPistonExtensionTexture());
        this.blockRenderer.renderPistonExtensionAllFaces(
            Block.pistonExtension,
            par1TileEntityPiston.xCoord,
            par1TileEntityPiston.yCoord,
            par1TileEntityPiston.zCoord,
            par1TileEntityPiston.getProgress(par8) < 0.5F);
        Block.pistonExtension.clearHeadTexture();
        var10.setTranslation(
            (double) ((float) par2 - (float) par1TileEntityPiston.xCoord),
            (double) ((float) par4 - (float) par1TileEntityPiston.yCoord),
            (double) ((float) par6 - (float) par1TileEntityPiston.zCoord));
        this.blockRenderer.renderPistonBaseAllFaces(
            var9,
            par1TileEntityPiston.xCoord,
            par1TileEntityPiston.yCoord,
            par1TileEntityPiston.zCoord);
      } else {
        this.blockRenderer.renderBlockAllFaces(
            var9,
            par1TileEntityPiston.xCoord,
            par1TileEntityPiston.yCoord,
            par1TileEntityPiston.zCoord);
      }

      var10.setTranslation(0.0D, 0.0D, 0.0D);
      var10.draw();
      ForgeHooksClient.afterBlockRender(var9, blockRenderer);
      RenderHelper.enableStandardItemLighting();
    }
  }
  private void func_159_a(EntityWallpaper_Kaevator entitywallpaper) {
    GL11.glScalef(16.0F / 256.0F, 16.0F / 256.0F, 1.0F / 16.0F);
    float f = -8.0F;
    float f1 = -8.0F;

    Tessellator tessellator = Tessellator.instance;

    float f2 = 0.0F;
    float f3 = 1.0F;
    float f4 = (float) (entitywallpaper.wallpaper / 16) / 16.0F;
    float f5 = (float) (entitywallpaper.wallpaper % 16) / 16.0F;
    float f6 = 1.0F / 16.0F;
    float f7 = 1.0F / 512.0F;

    int i = MathHelper.floor_double(entitywallpaper.posX);
    int j = MathHelper.floor_double(entitywallpaper.posY);
    int k = MathHelper.floor_double(entitywallpaper.posZ);

    float lRed = (float) entitywallpaper.red / 256.0F;
    float lGreen = (float) entitywallpaper.green / 256.0F;
    float lBlue = (float) entitywallpaper.blue / 256.0F;

    tessellator.startDrawingQuads();
    if (Minecraft.isAmbientOcclusionEnabled()) {

      renderWithAmbientOcclusion(i, j, k, 1.0F, 1.0F, 1.0F, entitywallpaper.direction);
      tessellator.setNormal(0.0F, 0.0F, 1F);
      tessellator.setBrightness(240);

      if (entitywallpaper.direction == 0) {
        tessellator.setColorOpaque_F(
            colorRedTopRight * lRed, colorGreenTopRight * lGreen, colorBlueTopRight * lBlue);
        tessellator.addVertexWithUV(f, f1, f2, f4 + f6, f5 + f6);
        tessellator.setColorOpaque_F(
            colorRedTopLeft * lRed, colorGreenTopLeft * lGreen, colorBlueTopLeft * lBlue);
        tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5);
        tessellator.setColorOpaque_F(
            colorRedBottomLeft * lRed, colorGreenBottomLeft * lGreen, colorBlueBottomLeft * lBlue);
        tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5);
        tessellator.setColorOpaque_F(
            colorRedBottomRight * lRed,
            colorGreenBottomRight * lGreen,
            colorBlueBottomRight * lBlue);
        tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6);
      } else if (entitywallpaper.direction == 2) {
        tessellator.setColorOpaque_F(
            colorRedBottomRight * lRed,
            colorGreenBottomRight * lGreen,
            colorBlueBottomRight * lBlue);
        tessellator.addVertexWithUV(f, f1, f2, f4 + f6, f5 + f6);
        tessellator.setColorOpaque_F(
            colorRedTopRight * lRed, colorGreenTopRight * lGreen, colorBlueTopRight * lBlue);
        tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5);
        tessellator.setColorOpaque_F(
            colorRedTopLeft * lRed, colorGreenTopLeft * lGreen, colorBlueTopLeft * lBlue);
        tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5);
        tessellator.setColorOpaque_F(
            colorRedBottomLeft * lRed, colorGreenBottomLeft * lGreen, colorBlueBottomLeft * lBlue);
        tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6);
      } else if (entitywallpaper.direction == 1) {
        tessellator.setColorOpaque_F(
            colorRedTopRight * lRed, colorGreenTopRight * lGreen, colorBlueTopRight * lBlue);
        tessellator.addVertexWithUV(f, f1, f2, f4 + f6, f5 + f6);
        tessellator.setColorOpaque_F(
            colorRedTopLeft * lRed, colorGreenTopLeft * lGreen, colorBlueTopLeft * lBlue);
        tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5);
        tessellator.setColorOpaque_F(
            colorRedBottomLeft * lRed, colorGreenBottomLeft * lGreen, colorBlueBottomLeft * lBlue);
        tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5);
        tessellator.setColorOpaque_F(
            colorRedBottomRight * lRed,
            colorGreenBottomRight * lGreen,
            colorBlueBottomRight * lBlue);
        tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6);
      } else if (entitywallpaper.direction == 3) {
        tessellator.setColorOpaque_F(
            colorRedBottomLeft * lRed, colorGreenBottomLeft * lGreen, colorBlueBottomLeft * lBlue);
        tessellator.addVertexWithUV(f, f1, f2, f4 + f6, f5 + f6);
        tessellator.setColorOpaque_F(
            colorRedBottomRight * lRed,
            colorGreenBottomRight * lGreen,
            colorBlueBottomRight * lBlue);
        tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5);
        tessellator.setColorOpaque_F(
            colorRedTopRight * lRed, colorGreenTopRight * lGreen, colorBlueTopRight * lBlue);
        tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5);
        tessellator.setColorOpaque_F(
            colorRedTopLeft * lRed, colorGreenTopLeft * lGreen, colorBlueTopLeft * lBlue);
        tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6);
      }

      if (!entitywallpaper.isBlockLeft) {
        tessellator.setNormal(-1.0F, 0.0F, 0.0F);
        if (entitywallpaper.direction == 0) {
          tessellator.setColorOpaque_F(
              colorRedTopLeft * lRed, colorGreenTopLeft * lGreen, colorBlueTopLeft * lBlue);
          tessellator.addVertexWithUV(f, f1 + 16.0F, f3, f4 + f6, f5);
          tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5);
          tessellator.setColorOpaque_F(
              colorRedTopRight * lRed, colorGreenTopRight * lGreen, colorBlueTopRight * lBlue);
          tessellator.addVertexWithUV(f, f1, f2, f4 + f6 - f7, f5 + f6);
          tessellator.addVertexWithUV(f, f1, f3, f4 + f6 - f7, f5 + f6);
        } else if (entitywallpaper.direction == 2) {
          tessellator.setColorOpaque_F(
              colorRedTopRight * lRed, colorGreenTopRight * lGreen, colorBlueTopRight * lBlue);
          tessellator.addVertexWithUV(f, f1 + 16.0F, f3, f4 + f6, f5);
          tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5);
          tessellator.setColorOpaque_F(
              colorRedBottomRight * lRed,
              colorGreenBottomRight * lGreen,
              colorBlueBottomRight * lBlue);
          tessellator.addVertexWithUV(f, f1, f2, f4 + f6 - f7, f5 + f6);
          tessellator.addVertexWithUV(f, f1, f3, f4 + f6 - f7, f5 + f6);
        } else if (entitywallpaper.direction == 1) {
          tessellator.setColorOpaque_F(
              colorRedTopLeft * lRed, colorGreenTopLeft * lGreen, colorBlueTopLeft * lBlue);
          tessellator.addVertexWithUV(f, f1 + 16.0F, f3, f4 + f6, f5);
          tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5);
          tessellator.setColorOpaque_F(
              colorRedTopRight * lRed, colorGreenTopRight * lGreen, colorBlueTopRight * lBlue);
          tessellator.addVertexWithUV(f, f1, f2, f4 + f6 - f7, f5 + f6);
          tessellator.addVertexWithUV(f, f1, f3, f4 + f6 - f7, f5 + f6);
        } else if (entitywallpaper.direction == 3) {
          tessellator.setColorOpaque_F(
              colorRedBottomRight * lRed,
              colorGreenBottomRight * lGreen,
              colorBlueBottomRight * lBlue);
          tessellator.addVertexWithUV(f, f1 + 16.0F, f3, f4 + f6, f5);
          tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5);
          tessellator.setColorOpaque_F(
              colorRedBottomLeft * lRed,
              colorGreenBottomLeft * lGreen,
              colorBlueBottomLeft * lBlue);
          tessellator.addVertexWithUV(f, f1, f2, f4 + f6 - f7, f5 + f6);
          tessellator.addVertexWithUV(f, f1, f3, f4 + f6 - f7, f5 + f6);
        }
      }
      if (!entitywallpaper.isBlockUp) {

        tessellator.setNormal(0.0F, 1.0F, 0.0F);
        if (entitywallpaper.direction == 0) {
          tessellator.setColorOpaque_F(
              colorRedTopLeft * lRed, colorGreenTopLeft * lGreen, colorBlueTopLeft * lBlue);
          tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5);
          tessellator.addVertexWithUV(f, f1 + 16.0F, f3, f4 + f6, f5 + f7);
          tessellator.setColorOpaque_F(
              colorRedBottomLeft * lRed,
              colorGreenBottomLeft * lGreen,
              colorBlueBottomLeft * lBlue);
          tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f3, f4, f5 + f7);
          tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5);
        } else if (entitywallpaper.direction == 2) {
          tessellator.setColorOpaque_F(
              colorRedTopLeft * lRed, colorGreenTopLeft * lGreen, colorBlueTopLeft * lBlue);
          tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f3, f4, f5 + f7);
          tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5);
          tessellator.setColorOpaque_F(
              colorRedTopRight * lRed, colorGreenTopRight * lGreen, colorBlueTopRight * lBlue);
          tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5);
          tessellator.addVertexWithUV(f, f1 + 16.0F, f3, f4 + f6, f5 + f7);
        } else if (entitywallpaper.direction == 1) {
          tessellator.setColorOpaque_F(
              colorRedBottomLeft * lRed,
              colorGreenBottomLeft * lGreen,
              colorBlueBottomLeft * lBlue);
          tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f3, f4, f5 + f7);
          tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5);
          tessellator.setColorOpaque_F(
              colorRedTopLeft * lRed, colorGreenTopLeft * lGreen, colorBlueTopLeft * lBlue);
          tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5);
          tessellator.addVertexWithUV(f, f1 + 16.0F, f3, f4 + f6, f5 + f7);
        } else if (entitywallpaper.direction == 3) {
          tessellator.setColorOpaque_F(
              colorRedTopRight * lRed, colorGreenTopRight * lGreen, colorBlueTopRight * lBlue);
          tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f3, f4, f5 + f7);
          tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5);
          tessellator.setColorOpaque_F(
              colorRedBottomRight * lRed,
              colorGreenBottomRight * lGreen,
              colorBlueBottomRight * lBlue);
          tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5);
          tessellator.addVertexWithUV(f, f1 + 16.0F, f3, f4 + f6, f5 + f7);
        }
      }
      if (!entitywallpaper.isBlockRight) {

        tessellator.setNormal(1F, 0.0F, 0.0F);
        if (entitywallpaper.direction == 0) {
          tessellator.setColorOpaque_F(
              colorRedBottomRight * lRed,
              colorGreenBottomRight * lGreen,
              colorBlueBottomRight * lBlue);
          tessellator.addVertexWithUV(f + 16.0F, f1, f3, f4 + f7, f5 + f6);
          tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6);
          tessellator.setColorOpaque_F(
              colorRedBottomLeft * lRed,
              colorGreenBottomLeft * lGreen,
              colorBlueBottomLeft * lBlue);
          tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5);
          tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f3, f4 + f7, f5);
        } else if (entitywallpaper.direction == 2) {
          tessellator.setColorOpaque_F(
              colorRedBottomLeft * lRed,
              colorGreenBottomLeft * lGreen,
              colorBlueBottomLeft * lBlue);
          tessellator.addVertexWithUV(f + 16.0F, f1, f3, f4 + f7, f5 + f6);
          tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6);
          tessellator.setColorOpaque_F(
              colorRedTopLeft * lRed, colorGreenTopLeft * lGreen, colorBlueTopLeft * lBlue);
          tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5);
          tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f3, f4 + f7, f5);
        } else if (entitywallpaper.direction == 1) {
          tessellator.setColorOpaque_F(
              colorRedBottomRight * lRed,
              colorGreenBottomRight * lGreen,
              colorBlueBottomRight * lBlue);
          tessellator.addVertexWithUV(f + 16.0F, f1, f3, f4 + f7, f5 + f6);
          tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6);
          tessellator.setColorOpaque_F(
              colorRedBottomLeft * lRed,
              colorGreenBottomLeft * lGreen,
              colorBlueBottomLeft * lBlue);
          tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5);
          tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f3, f4 + f7, f5);
        } else if (entitywallpaper.direction == 3) {
          tessellator.setColorOpaque_F(
              colorRedTopLeft * lRed, colorGreenTopLeft * lGreen, colorBlueTopLeft * lBlue);
          tessellator.addVertexWithUV(f + 16.0F, f1, f3, f4 + f7, f5 + f6);
          tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6);
          tessellator.setColorOpaque_F(
              colorRedTopRight * lRed, colorGreenTopRight * lGreen, colorBlueTopRight * lBlue);
          tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5);
          tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f3, f4 + f7, f5);
        }
      }
      if (!entitywallpaper.isBlockDown) {

        tessellator.setNormal(0.0F, -1.0F, 0.0F);
        if (entitywallpaper.direction == 0) {
          tessellator.setColorOpaque_F(
              colorRedTopRight * lRed, colorGreenTopRight * lGreen, colorBlueTopRight * lBlue);
          tessellator.addVertexWithUV(f, f1, f3, f4 + f6, f5 + f6 - f7);
          tessellator.addVertexWithUV(f, f1, f2, f4 + f6, f5 + f6);
          tessellator.setColorOpaque_F(
              colorRedBottomRight * lRed,
              colorGreenBottomRight * lGreen,
              colorBlueBottomRight * lBlue);
          tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6);
          tessellator.addVertexWithUV(f + 16.0F, f1, f3, f4, f5 + f6 - f7);
        } else if (entitywallpaper.direction == 2) {
          tessellator.setColorOpaque_F(
              colorRedBottomRight * lRed,
              colorGreenBottomRight * lGreen,
              colorBlueBottomRight * lBlue);
          tessellator.addVertexWithUV(f, f1, f3, f4 + f6, f5 + f6 - f7);
          tessellator.addVertexWithUV(f, f1, f2, f4 + f6, f5 + f6);
          tessellator.setColorOpaque_F(
              colorRedBottomLeft * lRed,
              colorGreenBottomLeft * lGreen,
              colorBlueBottomLeft * lBlue);
          tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6);
          tessellator.addVertexWithUV(f + 16.0F, f1, f3, f4, f5 + f6 - f7);
        } else if (entitywallpaper.direction == 1) {
          tessellator.setColorOpaque_F(
              colorRedTopRight * lRed, colorGreenTopRight * lGreen, colorBlueTopRight * lBlue);
          tessellator.addVertexWithUV(f, f1, f3, f4 + f6, f5 + f6 - f7);
          tessellator.addVertexWithUV(f, f1, f2, f4 + f6, f5 + f6);
          tessellator.setColorOpaque_F(
              colorRedBottomRight * lRed,
              colorGreenBottomRight * lGreen,
              colorBlueBottomRight * lBlue);
          tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6);
          tessellator.addVertexWithUV(f + 16.0F, f1, f3, f4, f5 + f6 - f7);
        } else if (entitywallpaper.direction == 3) {
          tessellator.setColorOpaque_F(
              colorRedBottomLeft * lRed,
              colorGreenBottomLeft * lGreen,
              colorBlueBottomLeft * lBlue);
          tessellator.addVertexWithUV(f, f1, f3, f4 + f6, f5 + f6 - f7);
          tessellator.addVertexWithUV(f, f1, f2, f4 + f6, f5 + f6);
          tessellator.setColorOpaque_F(
              colorRedTopLeft * lRed, colorGreenTopLeft * lGreen, colorBlueTopLeft * lBlue);
          tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6);
          tessellator.addVertexWithUV(f + 16.0F, f1, f3, f4, f5 + f6 - f7);
        }
      }

    } else {

      float lLightBlock = renderManager.worldObj.getLightBrightness(i, j, k);
      GL11.glColor3f(
          lLightBlock * (float) entitywallpaper.red / 256.0F,
          lLightBlock * (float) entitywallpaper.green / 256.0F,
          lLightBlock * (float) entitywallpaper.blue / 256.0F);

      tessellator.setBrightness(240);

      tessellator.setNormal(0.0F, 0.0F, -1F);
      tessellator.addVertexWithUV(f, f1, f2, f4 + f6, f5 + f6);
      tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5);
      tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5);
      tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6);

      if (!entitywallpaper.isBlockLeft) {
        tessellator.setNormal(-1.0F, 0.0F, 0.0F);
        tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5);
        tessellator.addVertexWithUV(f, f1, f2, f4 + f6 - f7, f5 + f6);
        tessellator.addVertexWithUV(f, f1, f3, f4 + f6 - f7, f5 + f6);
        tessellator.addVertexWithUV(f, f1 + 16.0F, f3, f4 + f6, f5);
      }
      if (!entitywallpaper.isBlockUp) {
        tessellator.setNormal(0.0F, 1.0F, 0.0F);
        tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5);
        tessellator.addVertexWithUV(f, f1 + 16.0F, f2, f4 + f6, f5);
        tessellator.addVertexWithUV(f, f1 + 16.0F, f3, f4 + f6, f5 + f7);
        tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f3, f4, f5 + f7);
      }
      if (!entitywallpaper.isBlockRight) {
        tessellator.setNormal(1F, 0.0F, 0.0F);
        tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6);
        tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f2, f4, f5);
        tessellator.addVertexWithUV(f + 16.0F, f1 + 16.0F, f3, f4 + f7, f5);
        tessellator.addVertexWithUV(f + 16.0F, f1, f3, f4 + f7, f5 + f6);
      }
      if (!entitywallpaper.isBlockDown) {
        tessellator.setNormal(0.0F, -1.0F, 0.0F);
        tessellator.addVertexWithUV(f, f1, f2, f4 + f6, f5 + f6);
        tessellator.addVertexWithUV(f + 16.0F, f1, f2, f4, f5 + f6);
        tessellator.addVertexWithUV(f + 16.0F, f1, f3, f4, f5 + f6 - f7);
        tessellator.addVertexWithUV(f, f1, f3, f4 + f6, f5 + f6 - f7);
      }
    }

    tessellator.draw();
  }