Package net.minecraft.util

Examples of net.minecraft.util.Icon


      if(renderer.renderAllFaces || renderTop)
      {
        rendered = true;

        Icon icon = block.getIcon(1, bMeta);
        float flowDir = (float) BlockFluidRoot.getFlowDirection(world, x, y, z);

        if(flowDir > -999.0F)
        {
          icon = block.getIcon(2, bMeta);
        }

        d2 -= d6;
        d3 -= d6;
        d4 -= d6;
        d5 -= d6;
        double d7;
        double d8;
        double d9;
        double d10;
        double d11;
        double d12;
        double d13;
        double d14;

        if(flowDir < -999.0F)
        {
          d8 = icon.getInterpolatedU(0.0D);
          d12 = icon.getInterpolatedV(0.0D);
          d7 = d8;
          d11 = icon.getInterpolatedV(16.0D);
          d10 = icon.getInterpolatedU(16.0D);
          d14 = d11;
          d9 = d10;
          d13 = d12;
        }
        else
        {
          f8 = MathHelper.sin(flowDir) * 0.25F;
          f7 = MathHelper.cos(flowDir) * 0.25F;
          d8 = icon.getInterpolatedU(8.0F + (-f7 - f8) * 16.0F);
          d12 = icon.getInterpolatedV(8.0F + (-f7 + f8) * 16.0F);
          d7 = icon.getInterpolatedU(8.0F + (-f7 + f8) * 16.0F);
          d11 = icon.getInterpolatedV(8.0F + (f7 + f8) * 16.0F);
          d10 = icon.getInterpolatedU(8.0F + (f7 + f8) * 16.0F);
          d14 = icon.getInterpolatedV(8.0F + (f7 - f8) * 16.0F);
          d9 = icon.getInterpolatedU(8.0F + (f7 - f8) * 16.0F);
          d13 = icon.getInterpolatedV(8.0F + (-f7 - f8) * 16.0F);
        }

        tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
        f8 = 1.0F;
        tessellator.setColorOpaque_F(f4 * f8 * red, f4 * f8 * green, f4 * f8 * blue);

        if(!rises)
        {
          tessellator.addVertexWithUV(x + 0, y + d2, z + 0, d8, d12);
          tessellator.addVertexWithUV(x + 0, y + d3, z + 1, d7, d11);
          tessellator.addVertexWithUV(x + 1, y + d4, z + 1, d10, d14);
          tessellator.addVertexWithUV(x + 1, y + d5, z + 0, d9, d13);
        }
        else
        {
          tessellator.addVertexWithUV(x + 1, y + 1 - d5, z + 0, d9, d13);
          tessellator.addVertexWithUV(x + 1, y + 1 - d4, z + 1, d10, d14);
          tessellator.addVertexWithUV(x + 0, y + 1 - d3, z + 1, d7, d11);
          tessellator.addVertexWithUV(x + 0, y + 1 - d2, z + 0, d8, d12);
        }
      }

      if(renderer.renderAllFaces || renderBottom)
      {
        rendered = true;

        tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y - 1, z));
        float f10 = 1.0F;

        if(!rises)
        {
          tessellator.setColorOpaque_F(f3 * f10, f3 * f10, f3 * f10);
          renderer.renderFaceYNeg(block, x, y + d6, z, block.getIcon(0, bMeta));
        }
        else
        {
          tessellator.setColorOpaque_F(f4 * f10, f4 * f10, f4 * f10);
          renderer.renderFaceYPos(block, x, y + d6, z, block.getIcon(1, bMeta));
        }
      }

      for(int side = 0; side < 4; ++side)
      {
        int x2 = x;
        int z2 = z;

        switch(side)
        {
        case 0:
          --z2;
          break;
        case 1:
          ++z2;
          break;
        case 2:
          --x2;
          break;
        case 3:
          ++x2;
          break;
        }

        Icon icon1 = block.getIcon(side + 2, bMeta);

        if(renderer.renderAllFaces || renderSides[side])
        {
          rendered = true;

          double d15;
          double d16;
          double d17;
          double d18;
          double d19;
          double d20;

          if(side == 0)
          {
            d15 = d2;
            d17 = d5;
            d16 = x;
            d18 = x + 1;
            d19 = z + d6;
            d20 = z + d6;
          }
          else if(side == 1)
          {
            d15 = d4;
            d17 = d3;
            d16 = x + 1;
            d18 = x;
            d19 = z + 1 - d6;
            d20 = z + 1 - d6;
          }
          else if(side == 2)
          {
            d15 = d3;
            d17 = d2;
            d16 = x + d6;
            d18 = x + d6;
            d19 = z + 1;
            d20 = z;
          }
          else
          {
            d15 = d5;
            d17 = d4;
            d16 = x + 1 - d6;
            d18 = x + 1 - d6;
            d19 = z;
            d20 = z + 1;
          }
          float f11 = icon1.getInterpolatedU(0.0D);
          f8 = icon1.getInterpolatedU(8.0D);
          f7 = icon1.getInterpolatedV((1.0D - d15) * 16.0D * 0.5D);
          float f12 = icon1.getInterpolatedV((1.0D - d17) * 16.0D * 0.5D);
          float f13 = icon1.getInterpolatedV(8.0D);
          tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x2, y, z2));
          float f14 = 1.0F;

          if(side < 2)
          {
View Full Code Here


    FluidStack fluid = tank.getFluid();
    if (fluid != null && fluid.amount > 0)
    {
      Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);

      Icon fluidIcon = fluid.getFluid().getStillIcon();

      if (iconHeightRemainder > 0)
      {
        drawTexturedModelRectFromIcon(posX + 1, posY + 2, fluidIcon, 16, iconHeightRemainder);
      }
View Full Code Here

    {
      tessellator.setNormal(0.0F, 1.0F, 0.0F);
      renderer.renderFaceYPos(block, x, y, z, block.getIcon(1, 0));
    }

    Icon sideIcon = block.getIcon(3, meta);
    tessellator.setNormal(0.0F, 0.0F, -1F);
    renderer.renderFaceZNeg(block, x, y, z, sideIcon);
    tessellator.setNormal(0.0F, 0.0F, 1.0F);
    renderer.renderFaceZPos(block, x, y, z, sideIcon);
    tessellator.setNormal(-1F, 0.0F, 0.0F);
View Full Code Here

    if (!(tankUp))
    {
      tessellator.setNormal(0.0F, 1.0F, 0.0F);
      renderer.renderFaceYPos(block, x, y - 0.001D, z, block.getIcon(1, 0));
    }
    Icon sideIcon = block.getIcon(3, meta);
    tessellator.setNormal(0.0F, 0.0F, -1F);
    renderer.renderFaceZNeg(block, x, y, z + 0.001D, sideIcon);
    tessellator.setNormal(0.0F, 0.0F, 1.0F);
    renderer.renderFaceZPos(block, x, y, z - 0.001D, sideIcon);
    tessellator.setNormal(-1F, 0.0F, 0.0F);
View Full Code Here

      if (storedFluid != null && scale > 0)
      {
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        Block id = Block.blocksList[FluidRegistry.WATER.getBlockID()];
        Icon fluidIcon = storedFluid.getIcon();
        if (fluidIcon == null)
          fluidIcon = FluidRegistry.LAVA.getIcon();
        renderer.setRenderBounds(0.08F, 0.001F, 0.08F, 0.92, scale * 0.999F, 0.92F);
        tessellator.setNormal(0.0F, -1F, 0.0F);
        renderer.renderFaceYNeg(id, x, y, z, fluidIcon);
View Full Code Here

      FluidStack storedFluid = FluidStack.loadFluidStackFromNBT(item.getTagCompound().getCompoundTag("tileEntity"));
      int tankCapacity = 32000;

      if (storedFluid != null && storedFluid.getFluid() != null)
      {
        Icon fluidIcon = storedFluid.getFluid().getIcon();

        Tessellator tessellator = Tessellator.instance;
        RenderBlocks renderer = new RenderBlocks();

        GL11.glScalef(1.0F, 1.0F, -1.0F);
View Full Code Here

    if (tileentity instanceof TileEntityMonitorStorageFluid)
    {
      Fluid fluid = ((TileEntityMonitorStorageFluid) tileentity).getFluid();
      if (fluid == null || fluid.getIcon() == null)
        return;
      Icon fluidIcon = fluid.getFlowingIcon();

      GL11.glPushMatrix();
      GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);

      FontRenderer fr = Minecraft.getMinecraft().fontRenderer;
      ForgeDirection d = ForgeDirection.getOrientation(tileentity.blockMetadata);
      GL11.glTranslated(x + 0.5D, y + 0.5D, z + 0.5D);
      GL11.glTranslated(d.offsetX * 0.76D, d.offsetY * 0.76D, d.offsetZ * 0.76D);
      if (d == ForgeDirection.UP)
      {
        GL11.glScalef(1.0F, -1.0F, 1.0F);
        GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F);
      }

      if (d == ForgeDirection.DOWN)
      {
        GL11.glScalef(1.0F, -1.0F, 1.0F);
        GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(-90.0F, 0.0F, 0.0F, 1.0F);
      }

      if (d == ForgeDirection.EAST)
      {
        GL11.glScalef(-1.0F, -1.0F, -1.0F);
        GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
      }

      if (d == ForgeDirection.WEST)
      {
        GL11.glScalef(-1.0F, -1.0F, -1.0F);
        GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
      }

      if (d == ForgeDirection.NORTH)
      {
        GL11.glScalef(-1.0F, -1.0F, -1.0F);
      }

      if (d == ForgeDirection.SOUTH)
      {
        GL11.glScalef(-1.0F, -1.0F, -1.0F);
        GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F);
      }

      GL11.glTranslatef(0.01F, 0.13F, -0.24F);
      GL11.glScalef(0.0625F * 0.25F, 0.0625F * 0.25F, 0.01612903F);

      long qty = ((TileEntityMonitorStorageFluid) tileentity).getAmount();
      if (qty > 999999999999L)
      {
        qty = 999999999999L;
      }
      String msg = Long.toString(qty) + "mB";
      if (Extracells.shortenedBuckets)
      {
        if (qty > 1000000000L)
          msg = Long.toString(qty / 1000000000L) + "MegaB";
        else if (qty > 1000000L)
          msg = Long.toString(qty / 1000000L) + "KiloB";
        else if (qty > 9999L)
        {
          msg = Long.toString(qty / 1000L) + "B";
        }
      }

      TileEntityMonitorStorageFluid TE = (TileEntityMonitorStorageFluid) tileentity;
      if (TE.isMachineActive())
      {
        GL11.glTranslated(-8.6F, -16.3, -1.2F);
        Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
        Tessellator cake = Tessellator.instance;
        cake.startDrawingQuads();
        cake.setBrightness(255);
        cake.setColorRGBA_F(1.0f, 1.0f, 1.0f, 1.0f);
        cake.addVertexWithUV(0, 16, 0, fluidIcon.getMinU(), fluidIcon.getMaxV());
        cake.addVertexWithUV(16, 16, 0, fluidIcon.getMaxU(), fluidIcon.getMaxV());
        cake.addVertexWithUV(16, 0, 0, fluidIcon.getMaxU(), fluidIcon.getMinV());
        cake.addVertexWithUV(0, 0, 0, fluidIcon.getMinU(), fluidIcon.getMinV());
        cake.draw();

        int width = fr.getStringWidth(msg);
        GL11.glTranslatef(8.25F - 0.5F * width, 24.0F, 0);
        GL11.glScaled(1, 0.5, 1);
View Full Code Here

    glEnd();
  }

  private void renderItem3D(EntityLiving par1EntityLiving, ItemStack par2ItemStack, int par3)
  {
    Icon icon = par1EntityLiving.getItemIcon(par2ItemStack, par3);

    if (icon == null)
    {
      GL11.glPopMatrix();
      return;
    }

    Tessellator tessellator = Tessellator.instance;
    float f = icon.getMinU();
    float f1 = icon.getMaxU();
    float f2 = icon.getMinV();
    float f3 = icon.getMaxV();
    float f4 = 0.0F;
    float f5 = 0.3F;
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    GL11.glTranslatef(-f4, -f5, 0.0F);
    float f6 = 1.5F;
    GL11.glScalef(f6, f6, f6);
    GL11.glRotatef(50.0F, 0.0F, 1.0F, 0.0F);
    GL11.glRotatef(335.0F, 0.0F, 0.0F, 1.0F);
    GL11.glTranslatef(-0.9375F, -0.0625F, 0.0F);
    ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 0.0625F);
    GL11.glDisable(GL12.GL_RESCALE_NORMAL);
  }
View Full Code Here

      {
        try
        {
          Block block = Block.blocksList[((ItemBlock) checkStack.getItem()).getBlockID()];

          Icon icon = block.getIcon(side, checkStack.getItemDamage());

          if (icon != null)
          {
            return icon;
          }
View Full Code Here

      float anaglyphBlue = (red * 30.0F + blue * 70.0F) / 100.0F;
      red = anaglyphRed;
      green = anaglyphGreen;
      blue = anaglyphBlue;
    }
    Icon iconGlass, iconStreaks, iconSide, iconOverlay;

    iconGlass = block.getIcon(0, metadata);
    iconStreaks = block.getIcon(0, 16 | metadata);
    iconSide = block.getSideTextureIndex();
    iconOverlay = block.getBlockOverlayTexture();

    double minXGlass = iconGlass.getMinU();
    double maxXGlass = iconGlass.getMaxU();
    double minYGlass = iconGlass.getMinV();
    double maxYGlass = iconGlass.getMaxV();

    double minXStreaks = iconStreaks.getMinU();
    double maxXStreaks = iconStreaks.getMaxU();
    double minYStreaks = iconStreaks.getMinV();
    double maxYStreaks = iconStreaks.getMaxV();
View Full Code Here

TOP

Related Classes of net.minecraft.util.Icon

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.