Package net.minecraft.util

Examples of net.minecraft.util.IIcon


    GL11.glScalef(1F, -1F, -1F);
    model.render();
    GL11.glPopMatrix();

    int meta = tile.getWorldObj() == null ? forcedMetadata : tile.getBlockMetadata();
    IIcon icon = BlockModFlower.icons[meta];
    Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
    float f = icon.getMinU();
    float f1 = icon.getMaxU();
    float f2 = icon.getMinV();
    float f3 = icon.getMaxV();
    GL11.glTranslatef(0.25F, 0.4F, 0.5F);
    GL11.glScalef(0.5F, 0.5F, 0.5F);
    ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 32F);
    GL11.glColor3f(1F, 1F, 1F);
    GL11.glPopMatrix();
  }
View Full Code Here


    float w = -v * 3.5F;

    if(pool.getWorldObj() != null) {
      Block below = pool.getWorldObj().getBlock(pool.xCoord, pool.yCoord - 1, pool.zCoord);
      if(below instanceof IPoolOverlayProvider) {
        IIcon overlay = ((IPoolOverlayProvider) below).getIcon(pool.getWorldObj(), pool.xCoord, pool.yCoord - 1, pool.zCoord);
        if(overlay != null) {
          GL11.glPushMatrix();
          GL11.glEnable(GL11.GL_BLEND);
          GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
          GL11.glDisable(GL11.GL_ALPHA_TEST);
          GL11.glColor4f(1F, 1F, 1F, (float) ((Math.sin((ClientTickHandler.ticksInGame + f) / 20.0) + 1) * 0.3 + 0.2));
          GL11.glTranslatef(-0.5F, -1F - 0.43F, -0.5F);
          GL11.glRotatef(90F, 1F, 0F, 0F);
          GL11.glScalef(s, s, s);

          renderIcon(0, 0, overlay, 16, 16, 240);

          GL11.glEnable(GL11.GL_ALPHA_TEST);
          GL11.glDisable(GL11.GL_BLEND);
          GL11.glPopMatrix();
        }
      }
    }

    if(waterLevel > 0) {
      s = 1F / 256F * 14F;
      GL11.glPushMatrix();
      GL11.glEnable(GL11.GL_BLEND);
      GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
      GL11.glDisable(GL11.GL_ALPHA_TEST);
      GL11.glColor4f(1F, 1F, 1F, 1F);
      GL11.glTranslatef(w, -1F - (0.43F - waterLevel), w);
      GL11.glRotatef(90F, 1F, 0F, 0F);
      GL11.glScalef(s, s, s);

      IIcon waterIcon = Blocks.water.getIcon(0, 0);

      ShaderHelper.useShader(ShaderHelper.manaPool);
      renderIcon(0, 0, waterIcon, 16, 16, 240);
      ShaderHelper.releaseShader();

View Full Code Here

  // Copied from RenderBlocks
  public void drawCrossedSquares(IBlockAccess blockAccess, Block par1Block, int x, int y, int z, double par3, double par5, double par7, float par9, RenderBlocks render) {
    Tessellator tessellator = Tessellator.instance;

    // Only change here, to use xyz rather than side/meta
    IIcon icon = render.getBlockIcon(par1Block, blockAccess, x, y, z, 0);

    double d3 = icon.getMinU();
    double d4 = icon.getMinV();
    double d5 = icon.getMaxU();
    double d6 = icon.getMaxV();
    double d7 = 0.45D * par9;
    double d8 = par3 + 0.5D - d7;
    double d9 = par3 + 0.5D + d7;
    double d10 = par7 + 0.5D - d7;
    double d11 = par7 + 0.5D + d7;
View Full Code Here

          GL11.glColor4f(1F, 1F, 1F, 1F);

          ItemStack stack = altar.getStackInSlot(i);
          Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture);
          IIcon icon = stack.getItem().getIcon(stack, 0);
          if(icon != null) {
            Color color = new Color(stack.getItem().getColorFromItemStack(stack, 0));
            GL11.glColor3ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue());
            float f = icon.getMinU();
            float f1 = icon.getMaxU();
            float f2 = icon.getMinV();
            float f3 = icon.getMaxV();
            ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F);
            GL11.glColor3f(1F, 1F, 1F);
          }

          GL11.glPopMatrix();
        }
View Full Code Here

public class RenderSpark extends RenderEntity {

  @Override
  public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {
    EntitySpark spark = (EntitySpark) par1Entity;
    IIcon iicon = ItemSpark.worldIcon;

    GL11.glPushMatrix();
    GL11.glTranslatef((float)par2, (float)par4, (float)par6);
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    GL11.glEnable(GL11.GL_BLEND);
View Full Code Here

          GL11.glTranslatef(-1F, -1.1F, 0F);
          GL11.glScalef(2F, 2F, 2F);
        } else {
          int renderPass = 0;
          do {
            IIcon icon = stack.getItem().getIcon(stack, renderPass);
            if(icon != null) {
              Color color = new Color(stack.getItem().getColorFromItemStack(stack, renderPass));
              GL11.glColor3ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue());
              float f = icon.getMinU();
              float f1 = icon.getMaxU();
              float f2 = icon.getMinV();
              float f3 = icon.getMaxV();

              ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F);
              GL11.glColor3f(1F, 1F, 1F);
            }
            renderPass++;
          } while(renderPass < stack.getItem().getRenderPasses(stack.getItemDamage()));
        }
View Full Code Here

  public void onPlayerRender(RenderPlayerEvent.Specials.Post event) {
    InventoryBaubles inv = PlayerHandler.getPlayerBaubles(event.entityPlayer);
    if(inv.getStackInSlot(0) != null && inv.getStackInSlot(0).getItem() instanceof ItemFlightTiara) {
      int meta = inv.getStackInSlot(0).getItemDamage();
      if(meta > 0 && meta <= ItemFlightTiara.wingIcons.length) {
        IIcon icon = ItemFlightTiara.wingIcons[meta - 1];
        Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture);

        boolean flying = event.entityPlayer.capabilities.isFlying;

        float rz = 120F;
        float rx = 20F + (float) ((Math.sin((double) (event.entityPlayer.ticksExisted + event.partialRenderTick) * (flying ? 0.4F : 0.2F)) + 0.5F) * (flying ? 30F : 5F));
        float ry = 0F;
        float h = 0.2F;
        float i = 0.15F;
        float s = 1F;

        GL11.glPushMatrix();
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        GL11.glColor4f(1F, 1F, 1F, 1F);

        switch(meta) {
        case 1 : { // Jibril
          h = 0.4F;
          break;
        }
        case 2 : { // Sephiroth
          s = 1.3F;
          break;
        }
        case 3 : { // Cirno
          h = -0.1F;
          rz = 0F;
          rx = 0F;
          i = 0.3F;
          break;
        }
        case 4 : { // Fire
          int light = 15728880;
          int lightmapX = light % 65536;
          int lightmapY = light / 65536;
          OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lightmapX, lightmapY);
          break;
        }
        case 5 : { // Kuroyukihime
          h = 0.8F;
          rz = 180F;
          ry = -rx;
          rx = 0F;
          s = 2F;
          break;
        }
        case 6 : { // Random Devil
          rz = 150F;
          break;
        }
        case 7 : { // Lyfa
          h = -0.1F;
          rz = 0F;
          ry = -rx;
          rx = 0F;
          GL11.glColor4f(1F, 1F, 1F, 0.5F + (float) Math.cos((double) (event.entityPlayer.ticksExisted + event.partialRenderTick) * 0.3F) * 0.2F);
          break;
        }
        }

        float f = icon.getMinU();
        float f1 = icon.getMaxU();
        float f2 = icon.getMinV();
        float f3 = icon.getMaxV();
        float sr = 1F / s;

        if(event.entityPlayer.isSneaking())
          GL11.glRotatef(28.64789F, 1.0F, 0.0F, 0.0F);

        GL11.glTranslatef(0F, h, i);

        GL11.glRotatef(rz, 0F, 0F, 1F);
        GL11.glRotatef(rx, 1F, 0F, 0F);
        GL11.glRotatef(ry, 0F, 1F, 0F);
        GL11.glScalef(s, s, s);
        ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 32F);
        GL11.glScalef(sr, sr, sr);
        GL11.glRotatef(-ry, 0F, 1F, 0F);
        GL11.glRotatef(-rx, 1F, 0F, 0F);
        GL11.glRotatef(-rz, 0F, 0F, 1F);

        if(meta != 2) { // Sephiroth
          GL11.glScalef(-1F, 1F, 1F);
          GL11.glRotatef(rz, 0F, 0F, 1F);
          GL11.glRotatef(rx, 1F, 0F, 0F);
          GL11.glRotatef(ry, 0F, 1F, 0F);
          GL11.glScalef(s, s, s);
          ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 32F);
          GL11.glScalef(sr, sr, sr);
          GL11.glRotatef(-ry, 1F, 0F, 0F);
          GL11.glRotatef(-rx, 1F, 0F, 0F);
          GL11.glRotatef(-rz, 0F, 0F, 1F);
        }
View Full Code Here

            GL11.glTranslatef(-1F, -1.1F, 0F);
            GL11.glScalef(2F, 2F, 2F);
          } else {
            int renderPass = 0;
            do {
              IIcon icon = stack.getItem().getIcon(stack, renderPass);
              if(icon != null) {
                Color color = new Color(stack.getItem().getColorFromItemStack(stack, renderPass));
                GL11.glColor3ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue());
                float f = icon.getMinU();
                float f1 = icon.getMaxU();
                float f2 = icon.getMinV();
                float f3 = icon.getMaxV();
                ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F);
                GL11.glColor3f(1F, 1F, 1F);
              }
              renderPass++;
            } while(renderPass < stack.getItem().getRenderPasses(stack.getItemDamage()));
          }
View Full Code Here

    render(item, color.getRGB());
  }

  public static void render(ItemStack item, int color_) {
    int dmg = item.getItemDamage();
    IIcon icon = item.getItem().getIconFromDamageForRenderPass(dmg, 1);
    float f = icon.getMinU();
    float f1 = icon.getMaxU();
    float f2 = icon.getMinV();
    float f3 = icon.getMaxV();
    float scale = 1F / 16F;

    GL11.glColor4f(1F, 1F, 1F, 1F);
    ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), scale);

    GL11.glPushMatrix();
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glEnable(GL11.GL_CULL_FACE);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
View Full Code Here

    }
  }

  public static void render(ItemStack item) {
    int dmg = item.getItemDamage();
    IIcon icon = item.getItem().getIconFromDamageForRenderPass(dmg, 0);
    float f = icon.getMinU();
    float f1 = icon.getMaxU();
    float f2 = icon.getMinV();
    float f3 = icon.getMaxV();
    float scale = 1F / 16F;

    GL11.glPushMatrix();
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glColor4f(1F, 1F, 1F, 1F);
    ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), scale);

    GL11.glDisable(GL11.GL_BLEND);
    GL11.glPopMatrix();

    GL11.glColor4f(1F, 1F, 1F, 1F);
View Full Code Here

TOP

Related Classes of net.minecraft.util.IIcon

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.