package client.gui.container;

import common.inventory.ContainerBrewingStand;
import common.inventory.IInventory;
import common.inventory.InventoryPlayer;

public class GuiBrewing extends GuiContainer {
	private final InventoryPlayer playerInv;
	private final IInventory brewer;

	public GuiBrewing(InventoryPlayer player, IInventory brewer) {
		super(new ContainerBrewingStand(player, brewer));
		this.playerInv = player;
		this.brewer = brewer;
	}

	public void draw() {
		super.draw();
		int progress = this.brewer.getField(0);
		if(progress > 0) {
			int value = (int)(28.0F * (1.0F - (float)progress / 400.0F));
			if(value > 0)
				this.rect(97, 16, 9, value, 0xffff20);
		}
	}

	public void addElements() {
		this.label(this.brewer.getCommandName(), 8, 6);
		this.label(this.playerInv.getCommandName(), 8, this.ySize - 96 + 2);
	}
}
