Search in sources :

Example 66 with IIcon

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

the class AMIngameGUI method RenderContingency.

public void RenderContingency(int i, int j) {
    AMVector2 contingencyPos = getShiftedVector(AMCore.config.getContingencyPosition(), i, j);
    IIcon icon = null;
    ContingencyTypes type = ExtendedProperties.For(Minecraft.getMinecraft().thePlayer).getContingencyType();
    switch(type) {
        case DAMAGE_TAKEN:
            icon = SpellIconManager.instance.getIcon("Contingency_Damage");
            break;
        case FALL:
            icon = SpellIconManager.instance.getIcon("Contingency_Fall");
            break;
        case HEALTH_LOW:
            icon = SpellIconManager.instance.getIcon("Contingency_Health");
            break;
        case ON_FIRE:
            icon = SpellIconManager.instance.getIcon("Contingency_Fire");
            break;
        case DEATH:
            icon = SpellIconManager.instance.getIcon("Contingency_Death");
            break;
        case NONE:
        default:
            return;
    }
    DrawIconAtXY(icon, "items", contingencyPos.iX, contingencyPos.iY, 16, 16, true);
    GL11.glColor3f(1.0f, 1.0f, 1.0f);
}
Also used : IIcon(net.minecraft.util.IIcon) AMVector2(am2.api.math.AMVector2) ContingencyTypes(am2.api.spell.enums.ContingencyTypes)

Example 67 with IIcon

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

the class GuiArcaneCompendium method drawRightPage_Block_Item.

private void drawRightPage_Block_Item(int cx, int cy, int mousex, int mousey) {
    RenderHelper.disableStandardItemLighting();
    int l = (width - xSize) / 2;
    int i1 = (height - ySize) / 2;
    if (craftingComponents == null) {
        AMGuiHelper.instance.DrawItemAtXY(renderStack, cx, cy, this.zLevel);
        if (mousex > cx && mousex < cx + 16) {
            if (mousey > cy && mousey < cy + 16) {
                stackTip = this.renderStack;
                tipX = mousex;
                tipY = mousey;
            }
        }
    } else {
        RenderRecipe(cx, cy, mousex, mousey);
    }
    if (this.renderStack.getItem() instanceof ItemSpellPart) {
        IIcon icon = SpellIconManager.instance.getIcon(entryName);
        mc.renderEngine.bindTexture(items);
        GL11.glColor4f(1, 1, 1, 1);
        DrawIconAtXY(icon, cx, cy, 16, 16);
    }
    RenderHelper.enableStandardItemLighting();
}
Also used : IIcon(net.minecraft.util.IIcon) ItemSpellPart(am2.items.ItemSpellPart)

Example 68 with IIcon

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

the class RenderSpellProjectile method doRenderSpellProjectile.

private void doRenderSpellProjectile(EntitySpellProjectile entity, double d, double d1, double d2, float f, float f1) {
    IIcon icon = entity.getIcon();
    if (icon == null) {
        return;
    }
    GL11.glPushMatrix();
    GL11.glPushAttrib(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glDisable(32826);
    /* RESCALE_NORMAL_EXT */
    GL11.glAlphaFunc(GL11.GL_GREATER, 0.003921569F);
    GL11.glDepthMask(false);
    // RenderHelper.disableStandardItemLighting();
    Minecraft.getMinecraft().renderEngine.bindTexture(projectile);
    int renderColor = entity.getColor();
    GL11.glTranslated(d, d1, d2);
    GL11.glScalef(0.5f, 0.5f, 0.5f);
    GL11.glRotatef(180F - RenderManager.instance.playerViewY, 0.0F, 1.0F, 0.0F);
    GL11.glRotatef(-RenderManager.instance.playerViewX, 1.0F, 0.0F, 0.0F);
    renderIcon(icon, renderColor);
    GL11.glPopAttrib();
    GL11.glPopMatrix();
}
Also used : IIcon(net.minecraft.util.IIcon)

Example 69 with IIcon

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

the class KeystoneReceptacleRenderer method renderSprite.

private void renderSprite(Tessellator tessellator) {
    IIcon IIcon = AMGuiIcons.instance.gatewayPortal;
    float min_u = IIcon.getMinU();
    float max_u = IIcon.getMaxU();
    float min_v = IIcon.getMinV();
    float max_v = IIcon.getMaxV();
    float f4 = 1.0F;
    float f5 = 0.5F;
    float f6 = 0.25F;
    tessellator.startDrawingQuads();
    tessellator.setBrightness(0xF00F0);
    tessellator.addVertexWithUV(0.0F - f5, 0.0F - f6, 0.0D, min_u, max_v);
    tessellator.addVertexWithUV(f4 - f5, 0.0F - f6, 0.0D, max_u, max_v);
    tessellator.addVertexWithUV(f4 - f5, f4 - f6, 0.0D, max_u, min_v);
    tessellator.addVertexWithUV(0.0F - f5, f4 - f6, 0.0D, min_u, min_v);
    tessellator.draw();
    GL11.glRotatef(180, 0, 1, 0);
    tessellator.startDrawingQuads();
    tessellator.setBrightness(0xF00F0);
    tessellator.addVertexWithUV(0.0F - f5, 0.0F - f6, 0.0D, min_u, max_v);
    tessellator.addVertexWithUV(f4 - f5, 0.0F - f6, 0.0D, max_u, max_v);
    tessellator.addVertexWithUV(f4 - f5, f4 - f6, 0.0D, max_u, min_v);
    tessellator.addVertexWithUV(0.0F - f5, f4 - f6, 0.0D, min_u, min_v);
    tessellator.draw();
}
Also used : IIcon(net.minecraft.util.IIcon)

Example 70 with IIcon

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

the class SimpleBlockRenderHandler method RenderInlayBlock.

private void RenderInlayBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
    int meta = world != null ? world.getBlockMetadata(x, y, z) : 0;
    IIcon renderIcon = block.getIcon(0, meta);
    renderer.uvRotateTop = 0;
    renderer.uvRotateBottom = 0;
    switch(meta) {
        case 0:
            break;
        case 1:
            renderer.uvRotateTop = 2;
            renderer.uvRotateBottom = 2;
            break;
        case 6:
            break;
        case 7:
            renderer.uvRotateTop = 1;
            renderer.uvRotateBottom = 2;
            break;
        case 8:
            renderer.uvRotateTop = 3;
            renderer.uvRotateBottom = 3;
            break;
        case 9:
            renderer.uvRotateTop = 2;
            renderer.uvRotateBottom = 1;
            break;
    }
    renderer.overrideBlockTexture = renderIcon;
    renderer.renderStandardBlock(block, x, y, z);
    renderer.overrideBlockTexture = null;
    renderer.uvRotateTop = 0;
    renderer.uvRotateBottom = 0;
}
Also used : IIcon(net.minecraft.util.IIcon)

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