Search in sources :

Example 1 with ContainerCraftGUI

use of binnie.core.gui.minecraft.ContainerCraftGUI in project Binnie by ForestryMC.

the class ControlFruitPressProgress method onRenderBackground.

@Override
@SideOnly(Side.CLIENT)
public void onRenderBackground(int guiWidth, int guiHeight) {
    CraftGUI.RENDER.texture(ControlFruitPressProgress.PressSlot, new Point(3, 52));
    ContainerCraftGUI container = Window.get(this).getContainer();
    IInventory inventory = Window.get(this).getInventory();
    Slot slotFromInventory = container.getSlotFromInventory(inventory, FruitPressMachine.SLOT_CURRENT);
    if (slotFromInventory == null) {
        return;
    }
    final ItemStack input = slotFromInventory.getStack();
    if (input.isEmpty() || FruitPressRecipeManager.getOutput(input) == null) {
        return;
    }
    FluidStack fluid = FruitPressRecipeManager.getOutput(input);
    RenderUtil.drawFluid(new Point(4, 52), fluid);
    RenderUtil.drawItem(new Point(4, 52), input);
}
Also used : IInventory(net.minecraft.inventory.IInventory) FluidStack(net.minecraftforge.fluids.FluidStack) Slot(net.minecraft.inventory.Slot) Point(binnie.core.gui.geometry.Point) ItemStack(net.minecraft.item.ItemStack) ContainerCraftGUI(binnie.core.gui.minecraft.ContainerCraftGUI) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

Point (binnie.core.gui.geometry.Point)1 ContainerCraftGUI (binnie.core.gui.minecraft.ContainerCraftGUI)1 IInventory (net.minecraft.inventory.IInventory)1 Slot (net.minecraft.inventory.Slot)1 ItemStack (net.minecraft.item.ItemStack)1 FluidStack (net.minecraftforge.fluids.FluidStack)1 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1