Search in sources :

Example 11 with ReagentStack

use of WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack in project BloodMagic by WayofTime.

the class TEBellJarItemRenderer method renderConduitItem.

private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) {
    GL11.glPushMatrix();
    GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F);
    FMLClientHandler.instance().getClient().renderEngine.bindTexture(mainResource);
    GL11.glPushMatrix();
    GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
    this.modelConduit.renderSpecialItem((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, 0);
    GL11.glPopMatrix();
    GL11.glPopMatrix();
    ReagentContainerInfo[] info = TEBellJar.getContainerInfoFromItem(item);
    if (info.length >= 1 && info[0] != null) {
        ReagentStack reagentStack = info[0].reagent;
        int capacity = info[0].capacity;
        if (reagentStack != null && reagentStack.reagent != null) {
            Reagent reagent = reagentStack.reagent;
            this.renderTankContents(translateX, translateY, translateZ, reagent.getColourRed(), reagent.getColourGreen(), reagent.getColourBlue(), 200 * reagentStack.amount / capacity);
        }
    }
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glEnable(GL11.GL_CULL_FACE);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glPushMatrix();
    GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F);
    FMLClientHandler.instance().getClient().renderEngine.bindTexture(mainResource);
    GL11.glPushMatrix();
    GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
    this.modelConduit.renderSpecialItem((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, 1);
    GL11.glPopMatrix();
    GL11.glPopMatrix();
    GL11.glDisable(GL11.GL_CULL_FACE);
    GL11.glDisable(GL11.GL_BLEND);
}
Also used : ReagentContainerInfo(WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo) ReagentStack(WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack) Reagent(WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent)

Example 12 with ReagentStack

use of WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack in project BloodMagic by WayofTime.

the class RenderHelper method onTickInGame.

public static boolean onTickInGame(Minecraft mc) {
    if (enabled && (mc.inGameHasFocus || mc.currentScreen == null || (mc.currentScreen instanceof GuiChat && showInChat)) && !mc.gameSettings.showDebugInfo) {
        EntityPlayer player = mc.thePlayer;
        player.getEntityData();
        if (SpellHelper.canPlayerSeeAlchemy(player)) {
            GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
            scaledResolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
            displayArmorStatus(mc);
            GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
        }
        ItemStack stack = player.inventory.armorItemInSlot(2);
        if (stack != null && stack.getItem() instanceof OmegaArmour) {
            int maxAmount = (int) APISpellHelper.getPlayerMaxReagentAmount(player);
            if (maxAmount > 0) {
                float val = APISpellHelper.getPlayerCurrentReagentAmount(player);
                ReagentStack reagentStack = new ReagentStack(APISpellHelper.getPlayerReagentType(player), (int) val);
                if (reagentStack != null && reagentStack.amount > 0) {
                    renderTestHUD(mc, reagentStack, maxAmount);
                }
            }
        }
        if (SpellHelper.canPlayerSeeLPBar(player)) {
            int max = APISpellHelper.getPlayerMaxLPTag(player);
            if (max > 1) {
                renderLPHUD(mc, APISpellHelper.getPlayerLPTag(player), max);
            }
        }
        float maxHP = APISpellHelper.getCurrentAdditionalMaxHP(player);
        // System.out.println("MaxHP: " + maxHP);
        if (maxHP > 0) {
            renderHPHUD(mc, APISpellHelper.getCurrentAdditionalHP(player), maxHP);
        }
    }
    return true;
}
Also used : ScaledResolution(net.minecraft.client.gui.ScaledResolution) OmegaArmour(WayofTime.alchemicalWizardry.common.items.armour.OmegaArmour) EntityPlayer(net.minecraft.entity.player.EntityPlayer) GuiChat(net.minecraft.client.gui.GuiChat) ReagentStack(WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack) ItemStack(net.minecraft.item.ItemStack)

Aggregations

ReagentStack (WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack)12 Reagent (WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent)5 ReagentContainerInfo (WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo)4 ItemStack (net.minecraft.item.ItemStack)3 OmegaArmour (WayofTime.alchemicalWizardry.common.items.armour.OmegaArmour)2 EntityPlayer (net.minecraft.entity.player.EntityPlayer)2 ResourceLocation (net.minecraft.util.ResourceLocation)2 Int3 (WayofTime.alchemicalWizardry.api.Int3)1 IReagentHandler (WayofTime.alchemicalWizardry.api.alchemy.energy.IReagentHandler)1 ReagentContainer (WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainer)1 IBloodOrb (WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb)1 OmegaParadigm (WayofTime.alchemicalWizardry.common.omega.OmegaParadigm)1 OmegaParadigmEarth (WayofTime.alchemicalWizardry.common.omega.OmegaParadigmEarth)1 OmegaParadigmFire (WayofTime.alchemicalWizardry.common.omega.OmegaParadigmFire)1 OmegaParadigmWater (WayofTime.alchemicalWizardry.common.omega.OmegaParadigmWater)1 OmegaParadigmWind (WayofTime.alchemicalWizardry.common.omega.OmegaParadigmWind)1 OmegaStructureParameters (WayofTime.alchemicalWizardry.common.omega.OmegaStructureParameters)1 TEAlchemicCalcinator (WayofTime.alchemicalWizardry.common.tileEntity.TEAlchemicCalcinator)1 TEBellJar (WayofTime.alchemicalWizardry.common.tileEntity.TEBellJar)1 HashMap (java.util.HashMap)1