Search in sources :

Example 36 with IIcon

use of net.minecraft.util.IIcon in project ArsMagica2 by Mithion.

the class SimpleBlockRenderHandler method renderCraftingAltar.

private void renderCraftingAltar(Block block, Block mimic, int x, int y, int z, int metadata, RenderBlocks renderer) {
    IIcon icon = mimic.getIcon(1, metadata);
    if (icon == null)
        icon = block.getIcon(1, 0);
    renderer.renderFaceYPos(block, x, y, z, icon);
    icon = mimic.getIcon(0, metadata);
    if (icon == null)
        icon = block.getIcon(0, 0);
    renderer.renderFaceYNeg(block, x, y, z, icon);
    icon = mimic.getIcon(2, metadata);
    if (icon == null)
        icon = block.getIcon(2, 0);
    renderer.renderFaceXPos(block, x, y, z, icon);
    icon = mimic.getIcon(3, metadata);
    if (icon == null)
        icon = block.getIcon(3, 0);
    renderer.renderFaceXNeg(block, x, y, z, icon);
    icon = mimic.getIcon(4, metadata);
    if (icon == null)
        icon = block.getIcon(4, 0);
    renderer.renderFaceZPos(block, x, y, z, icon);
    icon = mimic.getIcon(5, metadata);
    if (icon == null)
        icon = block.getIcon(5, 0);
    renderer.renderFaceZNeg(block, x, y, z, icon);
    renderer.renderFaceYPos(block, x, y, z, block.getIcon(1, 1));
    renderer.renderFaceYNeg(block, x, y, z, block.getIcon(0, 1));
    renderer.renderFaceXPos(block, x, y, z, block.getIcon(2, 1));
    renderer.renderFaceXNeg(block, x, y, z, block.getIcon(3, 1));
    renderer.renderFaceZPos(block, x, y, z, block.getIcon(4, 1));
    renderer.renderFaceZNeg(block, x, y, z, block.getIcon(5, 1));
}
Also used : IIcon(net.minecraft.util.IIcon)

Example 37 with IIcon

use of net.minecraft.util.IIcon in project ArsMagica2 by Mithion.

the class SpellScrollRenderer method RenderByAffinity.

public void RenderByAffinity(Affinity affinity) {
    Minecraft.getMinecraft().renderEngine.bindTexture(rLoc);
    IIcon icon = icons.get(affinity);
    if (icon == null)
        return;
    float TLX = icon.getMinU();
    float BRX = icon.getMaxU();
    float TLY = icon.getMinV();
    float BRY = icon.getMaxV();
    doRender(TLX, TLY, BRX, BRY);
}
Also used : IIcon(net.minecraft.util.IIcon)

Example 38 with IIcon

use of net.minecraft.util.IIcon in project Engine by VoltzEngine-Project.

the class GuiContainerBase method displayGauge.

/**
 * Based on BuildCraft
 */
protected void displayGauge(int j, int k, int line, int col, int width, int squaled, FluidStack liquid) {
    squaled -= 1;
    if (liquid == null) {
        return;
    }
    int start = 0;
    IIcon liquidIcon = null;
    Fluid fluid = liquid.getFluid();
    if (fluid != null && fluid.getStillIcon() != null) {
        liquidIcon = fluid.getStillIcon();
    }
    RenderUtility.setSpriteTexture(fluid.getSpriteNumber());
    if (liquidIcon != null) {
        while (true) {
            int x;
            if (squaled > 16) {
                x = 16;
                squaled -= 16;
            } else {
                x = squaled;
                squaled = 0;
            }
            this.drawTexturedModelRectFromIcon(j + col, k + line + 58 - x - start, liquidIcon, width, 16 - (16 - x));
            start = start + 16;
            if (x == 0 || squaled == 0) {
                break;
            }
        }
    }
}
Also used : IIcon(net.minecraft.util.IIcon) Fluid(net.minecraftforge.fluids.Fluid) Point(com.builtbroken.mc.lib.transform.vector.Point)

Example 39 with IIcon

use of net.minecraft.util.IIcon in project Engine by VoltzEngine-Project.

the class RenderUtility method renderCube.

/**
 * Renders a cube with custom block boundaries.
 */
public static void renderCube(double x1, double y1, double z1, double x2, double y2, double z2, Block block, IIcon overrideTexture, int meta) {
    GL11.glPushMatrix();
    if (RenderManager.instance != null && RenderManager.instance.renderEngine != null && TextureMap.locationBlocksTexture != null) {
        RenderManager.instance.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
    }
    Tessellator t = Tessellator.instance;
    GL11.glColor4f(1, 1, 1, 1);
    renderBlocks.setRenderBounds(x1, y1, z1, x2, y2, z2);
    t.startDrawingQuads();
    IIcon useTexture = overrideTexture != null ? overrideTexture : getTextureSafe(block, 0, meta);
    t.setNormal(0.0F, -1.0F, 0.0F);
    renderBlocks.renderFaceYNeg(block, 0, 0, 0, useTexture);
    useTexture = overrideTexture != null ? overrideTexture : getTextureSafe(block, 1, meta);
    t.setNormal(0.0F, 1.0F, 0.0F);
    renderBlocks.renderFaceYPos(block, 0, 0, 0, useTexture);
    useTexture = overrideTexture != null ? overrideTexture : getTextureSafe(block, 2, meta);
    t.setNormal(0.0F, 0.0F, -1.0F);
    renderBlocks.renderFaceZNeg(block, 0, 0, 0, useTexture);
    useTexture = overrideTexture != null ? overrideTexture : getTextureSafe(block, 3, meta);
    t.setNormal(0.0F, 0.0F, 1.0F);
    renderBlocks.renderFaceZPos(block, 0, 0, 0, useTexture);
    useTexture = overrideTexture != null ? overrideTexture : getTextureSafe(block, 4, meta);
    t.setNormal(-1.0F, 0.0F, 0.0F);
    renderBlocks.renderFaceXNeg(block, 0, 0, 0, useTexture);
    useTexture = overrideTexture != null ? overrideTexture : getTextureSafe(block, 5, meta);
    t.setNormal(1.0F, 0.0F, 0.0F);
    renderBlocks.renderFaceXPos(block, 0, 0, 0, useTexture);
    t.draw();
    GL11.glPopMatrix();
}
Also used : Tessellator(net.minecraft.client.renderer.Tessellator) IIcon(net.minecraft.util.IIcon)

Example 40 with IIcon

use of net.minecraft.util.IIcon in project Engine by VoltzEngine-Project.

the class BlockTile method getIcon.

@SideOnly(Side.CLIENT)
@Override
public IIcon getIcon(IBlockAccess access, int x, int y, int z, int side) {
    Tile tile = inject(access, x, y, z);
    IIcon value = tile.getIcon(side, access.getBlockMetadata(x, y, z));
    eject();
    return value;
}
Also used : IIcon(net.minecraft.util.IIcon) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Aggregations

IIcon (net.minecraft.util.IIcon)79 Tessellator (net.minecraft.client.renderer.Tessellator)19 SideOnly (cpw.mods.fml.relauncher.SideOnly)17 Vec3dCube (uk.co.qmunity.lib.vec.Vec3dCube)11 ItemStack (net.minecraft.item.ItemStack)6 EntityItem (net.minecraft.entity.item.EntityItem)5 Fluid (net.minecraftforge.fluids.Fluid)5 Rotation (uk.co.qmunity.lib.transform.Rotation)5 ForgeDirection (net.minecraftforge.common.util.ForgeDirection)4 AMVector2 (am2.api.math.AMVector2)3 Block (net.minecraft.block.Block)3 EntityDiggingFX (net.minecraft.client.particle.EntityDiggingFX)3 TubeColor (com.bluepowermod.api.tube.IPneumaticTube.TubeColor)2 IExplosiveHandler (com.builtbroken.mc.api.explosive.IExplosiveHandler)2 ITexturedExplosiveHandler (com.builtbroken.mc.api.explosive.ITexturedExplosiveHandler)2 IExplosiveContainerItem (com.builtbroken.mc.api.items.explosives.IExplosiveContainerItem)2 ItemStackWrapper (com.builtbroken.mc.prefab.items.ItemStackWrapper)2 ResourceLocation (net.minecraft.util.ResourceLocation)2 FluidStack (net.minecraftforge.fluids.FluidStack)2 DoubleCoordinates (network.rs485.logisticspipes.world.DoubleCoordinates)2