Search in sources :

Example 16 with IIcon

use of net.minecraft.util.IIcon in project ICBM-Classic by BuiltBrokenModding.

the class RenderGrenade method doRender.

@Override
public void doRender(Entity entity, double x, double y, double z, float par8, float par9) {
    /** Renders the grenade based on the explosive ID. */
    IIcon icon = ICBMClassic.itemGrenade.getIconFromDamage(((EntityGrenade) entity).haoMa.ordinal());
    GL11.glPushMatrix();
    GL11.glTranslatef((float) x, (float) y + 0.4f, (float) z);
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    GL11.glScalef(0.6F, 0.6F, 0.6F);
    RenderUtility.setSpriteTexture(new ItemStack(ICBMClassic.itemGrenade));
    Tessellator tessellator = Tessellator.instance;
    this.renderIcon(tessellator, icon);
    GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    GL11.glPopMatrix();
}
Also used : Tessellator(net.minecraft.client.renderer.Tessellator) IIcon(net.minecraft.util.IIcon) EntityGrenade(icbm.classic.content.entity.EntityGrenade) ItemStack(net.minecraft.item.ItemStack)

Example 17 with IIcon

use of net.minecraft.util.IIcon in project Minechem by iopleke.

the class MinecraftAchievementPage method drawBackground.

public static void drawBackground(Minecraft mc, float z, float scale, int columnWidth, int rowHeight) {
    int i = columnWidth + 288 >> 4;
    int j = rowHeight + 288 >> 4;
    int k = (columnWidth + 288) % 16;
    int l = (rowHeight + 288) % 16;
    Random random = new Random();
    float scaled = 16.0F / scale;
    int row, column, icon;
    for (row = 0; row * scaled - l < 155.0F; ++row) {
        float grayScale = 0.6F - (j + row) / 25.0F * 0.3F;
        MinechemHooks.resetGreyscale(grayScale);
        for (column = 0; column * scaled - k < 224.0F; ++column) {
            random.setSeed(mc.getSession().getPlayerID().hashCode() + i + column + (j + row) * 16);
            icon = random.nextInt(1 + j + row) + (j + row) / 2;
            IIcon iicon = Blocks.bedrock.getIcon(0, 0);
            if (icon <= 37 && j + row != 35) {
                if (icon == 22) {
                    if (random.nextInt(2) == 0) {
                        iicon = Blocks.diamond_ore.getIcon(0, 0);
                    } else {
                        iicon = Blocks.redstone_ore.getIcon(0, 0);
                    }
                } else if (icon == 10) {
                    iicon = Blocks.iron_ore.getIcon(0, 0);
                } else if (icon == 8) {
                    iicon = Blocks.coal_ore.getIcon(0, 0);
                } else if (icon > 4) {
                    iicon = Blocks.stone.getIcon(0, 0);
                } else if (icon > 0) {
                    iicon = Blocks.dirt.getIcon(0, 0);
                }
            }
            mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
            RenderHelper.drawTexturedRectUV(column * 16 - k, row * 16 - l, z, 16, 16, iicon);
        }
    }
}
Also used : Random(java.util.Random) IIcon(net.minecraft.util.IIcon)

Example 18 with IIcon

use of net.minecraft.util.IIcon in project Minechem by iopleke.

the class GuiFluidTank method draw.

@Override
public void draw(int guiLeft, int guiTop) {
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glColor3f(ColourHelper.getRed(colour), ColourHelper.getGreen(colour), ColourHelper.getBlue(colour));
    bindTexture(Compendium.Resource.GUI.Element.fluidTank);
    drawTexturedModalRect(guiLeft + posX, guiTop + posY, 0, 0, 18, 39, width, height);
    GL11.glColor3f(1.0F, 1.0F, 1.0F);
    int iconHeightRemainder = (height - 4) % 16;
    int iconWidthRemainder = (width - 2) % 16;
    FluidStack fluidStack = tank.getFluid();
    if (fluidStack != null && fluidStack.amount > 0) {
        bindTexture(TextureMap.locationBlocksTexture);
        IIcon fluidIcon = fluidStack.getFluid().getStillIcon();
        // Top left corner
        drawTexturedModelRectFromIcon(guiLeft + posX + 1, guiTop + posY + 2, fluidIcon, iconWidthRemainder, iconHeightRemainder);
        for (int i = 0; i <= (width - 4) / 16; i++) {
            // Top right only draw when more then 1 pass is needed
            if (i > 0) {
                drawTexturedModelRectFromIcon(guiLeft + posX + 1 + (i - 1) * 16 + iconWidthRemainder, guiTop + posY + 2, fluidIcon, 16, iconHeightRemainder);
            }
            for (int ii = 0; ii < (height - 6) / 16; ii++) {
                // Bottom right only draw when more then 1 pass is needed
                if (i > 0) {
                    drawTexturedModelRectFromIcon(guiLeft + posX + 1 + (i - 1) * 16 + iconWidthRemainder, guiTop + posY + 2 + ii * 16 + iconHeightRemainder, fluidIcon, 16, 16);
                }
                // Bottom left
                drawTexturedModelRectFromIcon(guiLeft + posX + 1, guiTop + posY + 2 + ii * 16 + iconHeightRemainder, fluidIcon, iconWidthRemainder, 16);
            }
        }
        bindTexture(Compendium.Resource.GUI.Element.fluidTank);
        drawTexturedModalRect(guiLeft + posX + 2, guiTop + posY + 1, 1, 1, 15, 37 - ((int) ((38) * ((float) fluidStack.amount / tank.getCapacity()))), width - 3, height - 2 - ((int) ((height - 1) * ((float) fluidStack.amount / tank.getCapacity()))));
    }
    bindTexture(Compendium.Resource.GUI.Element.fluidTank);
    drawTexturedModalRect(guiLeft + posX + 1, guiTop + posY + 1, 19, 1, 16, 37, width - 2, height - 2);
    drawTooltip(Mouse.getX() - guiLeft, Mouse.getY() - guiTop);
    GL11.glEnable(GL11.GL_LIGHTING);
}
Also used : IIcon(net.minecraft.util.IIcon) FluidStack(net.minecraftforge.fluids.FluidStack)

Example 19 with IIcon

use of net.minecraft.util.IIcon in project ClaySoldiersMod by SanAndreasP.

the class ItemHorseDoll method registerIcons.

@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister) {
    Map<String, IIcon> names = Maps.newHashMap();
    this.p_icons = Maps.newEnumMap(EnumHorseType.class);
    for (EnumHorseType type : EnumHorseType.VALUES) {
        if (type.itemData == null) {
            continue;
        }
        if (!names.containsKey(type.itemData.getValue0())) {
            names.put(type.itemData.getValue0(), iconRegister.registerIcon(type.itemData.getValue0()));
        }
        this.p_icons.put(type, names.get(type.itemData.getValue0()));
    }
    this.p_pegasusWings = iconRegister.registerIcon(ClaySoldiersMod.MOD_ID + ":doll_pegasus_wing");
}
Also used : IIcon(net.minecraft.util.IIcon) EnumHorseType(de.sanandrew.mods.claysoldiers.util.mount.EnumHorseType) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 20 with IIcon

use of net.minecraft.util.IIcon in project ClaySoldiersMod by SanAndreasP.

the class ItemTurtleDoll method registerIcons.

@Override
public void registerIcons(IIconRegister iconRegister) {
    Map<String, IIcon> names = Maps.newHashMap();
    this.icons = Maps.newEnumMap(EnumTurtleType.class);
    for (EnumTurtleType type : EnumTurtleType.VALUES) {
        if (type.itemData == null) {
            continue;
        }
        if (!names.containsKey(type.itemData.getValue0())) {
            names.put(type.itemData.getValue0(), iconRegister.registerIcon(type.itemData.getValue0()));
        }
        this.icons.put(type, names.get(type.itemData.getValue0()));
    }
    this.baseIcon = iconRegister.registerIcon(ClaySoldiersMod.MOD_ID + ":doll_turtle_base");
}
Also used : IIcon(net.minecraft.util.IIcon) EnumTurtleType(de.sanandrew.mods.claysoldiers.util.mount.EnumTurtleType)

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