Search in sources :

Example 1 with MultiblockProcessInMachine

use of blusunrize.immersiveengineering.common.blocks.metal.TileEntityMultiblockMetal.MultiblockProcessInMachine in project ImmersiveEngineering by BluSunrize.

the class GuiMixer method drawGuiContainerBackgroundLayer.

@Override
protected void drawGuiContainerBackgroundLayer(float f, int mx, int my) {
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    ClientUtils.bindTexture("immersiveengineering:textures/gui/mixer.png");
    this.drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
    for (MultiblockProcess process : tile.processQueue) if (process instanceof MultiblockProcessInMachine) {
        float mod = 1 - (process.processTick / (float) process.maxTicks);
        for (int slot : ((MultiblockProcessInMachine) process).getInputSlots()) {
            int h = (int) Math.max(1, mod * 16);
            this.drawTexturedModalRect(guiLeft + 24 + slot % 2 * 21, guiTop + 7 + slot / 2 * 18 + (16 - h), 176, 16 - h, 2, h);
        }
    }
    int stored = (int) (46 * (tile.getEnergyStored(null) / (float) tile.getMaxEnergyStored(null)));
    ClientUtils.drawGradientRect(guiLeft + 158, guiTop + 22 + (46 - stored), guiLeft + 165, guiTop + 68, 0xffb51500, 0xff600b00);
    float capacity = tile.tank.getCapacity();
    int fluidUpToNow = 0;
    int lastY = 0;
    for (int i = tile.tank.getFluidTypes() - 1; i >= 0; i--) {
        FluidStack fs = tile.tank.fluids.get(i);
        if (fs != null && fs.getFluid() != null) {
            fluidUpToNow += fs.amount;
            int newY = (int) (47 * (fluidUpToNow / capacity));
            ClientUtils.drawRepeatedFluidSprite(fs, guiLeft + 76, guiTop + 58 - newY, 58, newY - lastY);
            lastY = newY;
        }
    }
}
Also used : MultiblockProcess(blusunrize.immersiveengineering.common.blocks.metal.TileEntityMultiblockMetal.MultiblockProcess) FluidStack(net.minecraftforge.fluids.FluidStack) MultiblockProcessInMachine(blusunrize.immersiveengineering.common.blocks.metal.TileEntityMultiblockMetal.MultiblockProcessInMachine)

Example 2 with MultiblockProcessInMachine

use of blusunrize.immersiveengineering.common.blocks.metal.TileEntityMultiblockMetal.MultiblockProcessInMachine in project ImmersiveEngineering by BluSunrize.

the class GuiArcFurnace method drawGuiContainerBackgroundLayer.

@Override
protected void drawGuiContainerBackgroundLayer(float f, int mx, int my) {
    GlStateManager.color(1, 1, 1, 1);
    ClientUtils.bindTexture(texture);
    this.drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
    for (MultiblockProcess process : tile.processQueue) if (process instanceof MultiblockProcessInMachine) {
        float mod = process.processTick / (float) process.maxTicks;
        int slot = ((MultiblockProcessInMachine) process).getInputSlots()[0];
        int h = (int) Math.max(1, mod * 16);
        this.drawTexturedModalRect(guiLeft + 27 + slot % 3 * 21, guiTop + 34 + slot / 3 * 18 + (16 - h), 176, 16 - h, 2, h);
    }
    int stored = (int) (46 * (tile.getEnergyStored(null) / (float) tile.getMaxEnergyStored(null)));
    ClientUtils.drawGradientRect(guiLeft + 157, guiTop + 22 + (46 - stored), guiLeft + 164, guiTop + 68, 0xffb51500, 0xff600b00);
}
Also used : MultiblockProcess(blusunrize.immersiveengineering.common.blocks.metal.TileEntityMultiblockMetal.MultiblockProcess) MultiblockProcessInMachine(blusunrize.immersiveengineering.common.blocks.metal.TileEntityMultiblockMetal.MultiblockProcessInMachine)

Aggregations

MultiblockProcess (blusunrize.immersiveengineering.common.blocks.metal.TileEntityMultiblockMetal.MultiblockProcess)2 MultiblockProcessInMachine (blusunrize.immersiveengineering.common.blocks.metal.TileEntityMultiblockMetal.MultiblockProcessInMachine)2 FluidStack (net.minecraftforge.fluids.FluidStack)1