Package net.minecraft.util

Examples of net.minecraft.util.IIcon


            spriteHeight = texture.height/tilesY;
        }

        public IIcon getSprite(int index)
        {
            IIcon i = sprites[index];
            if(i == null)
                throw new IllegalArgumentException("Sprite at index: "+index+" from texture file "+resource+" was not preloaded.");
            return i;
        }
View Full Code Here


        return iconRegister.registerIcon(s);
    }

    public static TextureSpecial getTextureSpecial(IIconRegister iconRegister, String name) {
        TextureMap textureMap = (TextureMap) iconRegister;
        IIcon entry = textureMap.getTextureExtry(name);
        if (entry != null)
            throw new IllegalStateException("Texture: " + name + " is already registered");

        TextureSpecial icon = new TextureSpecial(name);
        textureMap.setTextureEntry(name, icon);
View Full Code Here

        if(stack.getFluid().isGaseous())
            alpha = (int) (fluidDensityToAlpha(density)*255);
        else
            bound.max.y = bound.min.y+(bound.max.y-bound.min.y)*density;
       
        IIcon tex = prepareFluidRender(stack, alpha);
        CCRenderState.startDrawing();
        renderFluidCuboid(bound, tex, res);
        CCRenderState.draw();
        postFluidRender();
    }
View Full Code Here

            int height = (int) (rect.h*density);
            rect.y +=rect.h-height;
            rect.h = height;
        }
       
        IIcon tex = prepareFluidRender(stack, alpha);
        CCRenderState.startDrawing();
        renderFluidQuad(
                new Vector3(rect.x, rect.y+rect.h, 0),
                new Vector3(rect.w,0, 0),
                new Vector3(0, -rect.h, 0), tex, res);
View Full Code Here

        private void damageSearch(Item item, List<ItemStack> permutations) {
            HashSet<String> damageIconSet = new HashSet<String>();
            for (int damage = 0; damage < 16; damage++)
                try {
                    ItemStack itemstack = new ItemStack(item, 1, damage);
                    IIcon icon = item.getIconIndex(itemstack);
                    String name = GuiContainerManager.concatenatedDisplayName(itemstack, false);
                    String s = name + "@" + (icon == null ? 0 : icon.hashCode());
                    if (!damageIconSet.contains(s)) {
                        damageIconSet.add(s);
                        permutations.add(itemstack);
                    }
                }
View Full Code Here

            tessellator.setColorOpaque_F(f1 * f, f1 * f2, f1 * f3);

            renderBlocks.clearOverrideBlockTexture();

            IIcon icon = BlockHopper.getHopperIcon("hopper");
            BlockHopper.getHopperIcon("hopper_inside");

            f = 0.125F;
            double d0 = 0.625D;

View Full Code Here

    public static void renderTorchAtAngle(RenderBlocks renderBlocks, Block par1Block, double par2, double par4, double par6, double par8, double par10)
    {
        // if (par1Block instanceof GCCoreBlockUnlitTorch)
        {
            final Tessellator tessellator = Tessellator.instance;
            IIcon icon = renderBlocks.getBlockIconFromSideAndMetadata(par1Block, 0, 0);

            if (par1Block == GCBlocks.unlitTorch)
            {
                icon = BlockUnlitTorch.torchIcons[1];
            }

            if (par1Block == GCBlocks.unlitTorchLit)
            {
                icon = BlockUnlitTorch.torchIcons[0];
            }

            final double d5 = icon.getMinU();
            final double d6 = icon.getMinV();
            final double d7 = icon.getMaxU();
            final double d8 = icon.getMaxV();
            final double d9 = icon.getInterpolatedU(7.0D);
            final double d10 = icon.getInterpolatedV(6.0D);
            final double d11 = icon.getInterpolatedU(9.0D);
            final double d12 = icon.getInterpolatedV(8.0D);
            final double d13 = icon.getInterpolatedU(7.0D);
            final double d14 = icon.getInterpolatedV(13.0D);
            final double d15 = icon.getInterpolatedU(9.0D);
            final double d16 = icon.getInterpolatedV(15.0D);
            par2 += 0.5D;
            par6 += 0.5D;
            final double d17 = par2 - 0.5D;
            final double d18 = par2 + 0.5D;
            final double d19 = par6 - 0.5D;
View Full Code Here

                }

                GL11.glColor4f(color.floatX(), color.floatY(), color.floatZ(), 1.0F);
            }

            IIcon iicon = FMLClientHandler.instance().getClientPlayerEntity().getItemIcon(item, i);

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

            FMLClientHandler.instance().getClient().getTextureManager().bindTexture(FMLClientHandler.instance().getClient().getTextureManager().getResourceLocation(item.getItemSpriteNumber()));
            VersionUtil.setMipMap(false, false);
            Tessellator tessellator = Tessellator.instance;
            float f = iicon.getMinU();
            float f1 = iicon.getMaxU();
            float f2 = iicon.getMinV();
            float f3 = iicon.getMaxV();
            float f4 = 0.0F;
            float f5 = 1.0F;
            GL11.glEnable(GL12.GL_RESCALE_NORMAL);
            GL11.glScalef(1.0F, -1.0F, 1.0F);
            float f6 = 16.0F;
            GL11.glScalef(f6, f6, f6);
            GL11.glTranslatef(-f4, -f5, 0.0F);
            ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F);
            GL11.glPopMatrix();
        }

        GL11.glPopMatrix();
    }
View Full Code Here

                }

                GL11.glColor4f(r, b / 2.0F, b, r + b / 1.5F);
            }

            IIcon iicon = FMLClientHandler.instance().getClientPlayerEntity().getItemIcon(item, i);

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

            FMLClientHandler.instance().getClient().getTextureManager().bindTexture(FMLClientHandler.instance().getClient().getTextureManager().getResourceLocation(item.getItemSpriteNumber()));
            VersionUtil.setMipMap(false, false);
            Tessellator tessellator = Tessellator.instance;
            float f = iicon.getMinU();
            float f1 = iicon.getMaxU();
            float f2 = iicon.getMinV();
            float f3 = iicon.getMaxV();
            float f4 = 0.0F;
            float f5 = 1.0F;
            GL11.glEnable(GL12.GL_RESCALE_NORMAL);
            GL11.glScalef(1.0F, -1.0F, 1.0F);
            float f6 = 16.0F;
            GL11.glScalef(f6, f6, f6);
            GL11.glTranslatef(-f4, -f5, 0.0F);
            ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F);
            GL11.glPopMatrix();
        }

        GL11.glPopMatrix();
    }
View Full Code Here

      FluidStack liquid = (FluidStack)data[dataIndex];

      TextureManager textureManager = Minecraft.getMinecraft().getTextureManager();

      Fluid fluid = liquid.getFluid();
      IIcon icon = fluid.getStillIcon();

      if(icon != null)
      {
        textureManager.bindTexture(TextureMap.locationBlocksTexture);

                double u = icon.getInterpolatedU(3.0);
                double u2 = icon.getInterpolatedU(13.0);
                double v = icon.getInterpolatedV(1.0);
                double v2 = icon.getInterpolatedV(15.0);

                GL11.glEnable(GL11.GL_TEXTURE_2D);
                GL11.glColor4d(1.0, 1.0, 1.0, 1.0);

            GL11.glBegin(GL11.GL_QUADS);
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.