Search in sources :

Example 1 with DistilleryLogic

use of binnie.extratrees.machines.distillery.DistilleryLogic in project Binnie by ForestryMC.

the class ControlDistilleryProgress method onRenderBackground.

@Override
@SideOnly(Side.CLIENT)
public void onRenderBackground(int guiWidth, int guiHeight) {
    CraftGUI.RENDER.texture(DISTILLERY_BASE, Point.ZERO);
    CraftGUI.RENDER.texturePercentage(LIQUID_FLOW, new Area(18, 0, 38, 66), Alignment.LEFT, this.progress);
    final DistilleryLogic component = Machine.getInterface(DistilleryLogic.class, Window.get(this).getInventory());
    FluidStack stack = null;
    if (component != null) {
        stack = component.getCurrentFluid();
    }
    if (stack != null) {
        for (int y = 0; y < 4; ++y) {
            RenderUtil.drawFluid(new Point(1, 1 + y * 16), stack);
        }
    }
}
Also used : Area(binnie.core.gui.geometry.Area) FluidStack(net.minecraftforge.fluids.FluidStack) DistilleryLogic(binnie.extratrees.machines.distillery.DistilleryLogic) Point(binnie.core.gui.geometry.Point) Point(binnie.core.gui.geometry.Point) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 2 with DistilleryLogic

use of binnie.extratrees.machines.distillery.DistilleryLogic in project Binnie by ForestryMC.

the class ControlDistilleryProgress method onRenderForeground.

@Override
@SideOnly(Side.CLIENT)
public void onRenderForeground(int guiWidth, int guiHeight) {
    DistilleryLogic distilleryLogic = Machine.getInterface(DistilleryLogic.class, Window.get(this).getInventory());
    if (distilleryLogic != null) {
        final int level = distilleryLogic.getLevel();
        GlStateManager.enableAlpha();
        CraftGUI.RENDER.texture(OUTPUT, new Point(47, 14 + level * 15));
        CraftGUI.RENDER.texture(DISTILLERY_OVERLAY, Point.ZERO);
    }
}
Also used : DistilleryLogic(binnie.extratrees.machines.distillery.DistilleryLogic) Point(binnie.core.gui.geometry.Point) Point(binnie.core.gui.geometry.Point) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

Point (binnie.core.gui.geometry.Point)2 DistilleryLogic (binnie.extratrees.machines.distillery.DistilleryLogic)2 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)2 Area (binnie.core.gui.geometry.Area)1 FluidStack (net.minecraftforge.fluids.FluidStack)1