Search in sources :

Example 1 with ReagentStack

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

the class RenderAlchemicCalcinator method renderTileEntityAt.

@Override
public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f) {
    if (tileEntity instanceof TEAlchemicCalcinator) {
        TEAlchemicCalcinator tileAltar = (TEAlchemicCalcinator) tileEntity;
        GL11.glPushMatrix();
        GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
        ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/AlchemicalCalcinator.png");
        FMLClientHandler.instance().getClient().renderEngine.bindTexture(test);
        GL11.glPushMatrix();
        GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
        this.modelConduit.render(null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
        GL11.glPopMatrix();
        GL11.glPopMatrix();
        GL11.glPushMatrix();
        if (tileAltar.getStackInSlot(1) != null) {
            boolean fancySaved = Minecraft.isFancyGraphicsEnabled();
            Minecraft.getMinecraft().gameSettings.fancyGraphics = true;
            float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(1));
            EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj());
            ghostEntityItem.hoverStart = 0.0F;
            ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(1));
            float displacement = 0.2F;
            if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock) {
                GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 0.7F, (float) d2 + 0.5F);
            } else {
                GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 10.4f / 16.0f, (float) d2 + 0.5F - 0.0625f * 2f);
            }
            GL11.glScalef(scaleFactor, scaleFactor, scaleFactor);
            if (!(ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock)) {
                GL11.glRotatef(90f, 1.0f, 0.0f, 0.0F);
            }
            customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0);
            Minecraft.getMinecraft().gameSettings.fancyGraphics = fancySaved;
        }
        GL11.glPopMatrix();
        GL11.glPushMatrix();
        if (tileAltar.getStackInSlot(0) != null) {
            boolean fancySaved = Minecraft.isFancyGraphicsEnabled();
            Minecraft.getMinecraft().gameSettings.fancyGraphics = true;
            float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(0));
            EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj());
            ghostEntityItem.hoverStart = 0.0F;
            ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(0));
            float displacement = -0.5F;
            if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock) {
                GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 0.7F, (float) d2 + 0.5F);
            } else {
                GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 10.4f / 16.0f, (float) d2 + 0.5F - 0.0625f * 2f);
            }
            GL11.glScalef(scaleFactor, scaleFactor, scaleFactor);
            if (!(ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock)) {
                GL11.glRotatef(90f, 1.0f, 0.0f, 0.0F);
            }
            customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0);
            Minecraft.getMinecraft().gameSettings.fancyGraphics = fancySaved;
        }
        GL11.glPopMatrix();
        ReagentContainerInfo[] info = tileAltar.getContainerInfo(ForgeDirection.UNKNOWN);
        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(d0, d1, d2, reagent.getColourRed(), reagent.getColourGreen(), reagent.getColourBlue(), 200 * reagentStack.amount / capacity);
            }
        }
    }
}
Also used : TEAlchemicCalcinator(WayofTime.alchemicalWizardry.common.tileEntity.TEAlchemicCalcinator) ReagentContainerInfo(WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo) ResourceLocation(net.minecraft.util.ResourceLocation) ReagentStack(WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack) ItemBlock(net.minecraft.item.ItemBlock) Reagent(WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent) EntityItem(net.minecraft.entity.item.EntityItem)

Example 2 with ReagentStack

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

the class RenderCrystalBelljar method renderTileEntityAt.

@Override
public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f) {
    if (tileEntity instanceof TEBellJar) {
        TEBellJar tileAltar = (TEBellJar) tileEntity;
        GL11.glPushMatrix();
        GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
        ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/CrystalBelljar.png");
        FMLClientHandler.instance().getClient().renderEngine.bindTexture(test);
        GL11.glPushMatrix();
        GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
        this.modelConduit.render(null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
        GL11.glPopMatrix();
        GL11.glPopMatrix();
        ReagentContainerInfo[] info = tileAltar.getContainerInfo(ForgeDirection.UNKNOWN);
        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(d0, d1, d2, reagent.getColourRed(), reagent.getColourGreen(), reagent.getColourBlue(), 200 * reagentStack.amount / capacity);
            }
        }
    }
}
Also used : ReagentContainerInfo(WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainerInfo) ResourceLocation(net.minecraft.util.ResourceLocation) TEBellJar(WayofTime.alchemicalWizardry.common.tileEntity.TEBellJar) ReagentStack(WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack) Reagent(WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent)

Example 3 with ReagentStack

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

the class TEAlchemicCalcinator method moveBufferToMain.

public void moveBufferToMain() {
    ReagentStack amountStack = this.bufferTank.drain(bufferTransferRate, false);
    int drainAmount = this.fill(ForgeDirection.UNKNOWN, amountStack, false);
    if (drainAmount > 0) {
        ReagentStack drainedStack = this.bufferTank.drain(drainAmount, true);
        this.fill(ForgeDirection.UNKNOWN, drainedStack, true);
    }
}
Also used : ReagentStack(WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack)

Example 4 with ReagentStack

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

the class RitualEffect method canDrainReagent.

public boolean canDrainReagent(IMasterRitualStone ritualStone, Reagent reagent, int amount, boolean doDrain) {
    if (ritualStone == null || reagent == null || amount == 0) {
        return false;
    }
    ReagentStack reagentStack = new ReagentStack(reagent, amount);
    ReagentStack stack = ritualStone.drain(ForgeDirection.UNKNOWN, reagentStack, false);
    if (stack != null && stack.amount >= amount) {
        if (doDrain) {
            ritualStone.drain(ForgeDirection.UNKNOWN, reagentStack, true);
        }
        return true;
    }
    return false;
}
Also used : ReagentStack(WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack)

Example 5 with ReagentStack

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

the class ItemBlockCrystalBelljar method addInformation.

@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
    ReagentContainer[] tanks = this.getReagentContainers(stack);
    if (tanks == null) {
        list.add(StatCollector.translateToLocal("tooltip.crystalbelljar.empty"));
    } else {
        list.add(StatCollector.translateToLocal("tooltip.crystalbelljar.contents"));
        for (int i = 0; i < tanks.length; i++) {
            if (tanks[i] == null || tanks[i].getReagent() == null || tanks[i].getReagent().reagent == null) {
                list.add("- Empty");
            } else {
                ReagentStack reagentStack = tanks[i].getReagent();
                list.add("- " + reagentStack.reagent.name + ": " + reagentStack.amount + "/" + tanks[i].getCapacity() / 1000 + "k AR");
            }
        }
    }
}
Also used : ReagentStack(WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack) ReagentContainer(WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainer)

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