gt: 		return maceratorCookTime * i / machineSpeed;
context: package com.keeperofmee.survival.tileentity;
  
  import net.minecraft.entity.player.EntityPlayer;
  import net.minecraft.init.Items;
  import net.minecraft.inventory.ISidedInventory;
  import net.minecraft.item.Item;
  import net.minecraft.item.ItemStack;
  import net.minecraft.nbt.NBTTagCompound;
  import net.minecraft.nbt.NBTTagList;
  import net.minecraft.tileentity.TileEntity;
  
  import com.keeperofmee.survival.api.electricity.IPowerStorage;
  import com.keeperofmee.survival.blocks.machines.SmMacerator;
  import com.keeperofmee.survival.recipes.CrushingRecipes;
  
  import cpw.mods.fml.relauncher.Side;
  import cpw.mods.fml.relauncher.SideOnly;
  
  public class TileEntityMacerator extends TileEntity implements ISidedInventory
  {
  	private static final int[] slotsTop = new int[] {0};
  	private static final int[] slotsBottom = new int[] {3, 2};
  	private static final int[] slotsSides = new int[] {1};
  	/**
  	 * The ItemStacks that hold the items currently being used in the macerator
  	 */
  	private ItemStack[] maceratorItemStacks = new ItemStack[4];
  
  	/** The number of ticks that the macerator will keep burning */
  	public int power;
  	public final int maxPower = 20000;
  	public int machineSpeed = 250;
  	public final static int powerTick = 32;
  	/** The number of ticks that the current item has been cooking for */
  	public int maceratorCookTime;
  	private String field_145958_o;
  	private static final String __OBFID = "CL_00000357";
  
  	/**
  	 * Returns the number of slots in the inventory.
  	 */
  	@Override
  	public int getSizeInventory()
  	{
  		return maceratorItemStacks.length;
  	}
  
  	/**
  	 * Returns the stack in slot i
  	 */
  	@Override
  	public ItemStack getStackInSlot(int p_70301_1_)
  	{
  		return maceratorItemStacks[p_70301_1_];
  	}
  
  	/**
  	 * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a
  	 * new stack.
  	 */
  	@Override
  	public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_)
  	{
  		if (maceratorItemStacks[p_70298_1_] != null)
  		{
  			ItemStack itemstack;
  
  			if (maceratorItemStacks[p_70298_1_].stackSize <= p_70298_2_)
  			{
  				itemstack = maceratorItemStacks[p_70298_1_];
  				maceratorItemStacks[p_70298_1_] = null;
  				return itemstack;
  			}
  			else
  			{
  				itemstack = maceratorItemStacks[p_70298_1_].splitStack(p_70298_2_);
  
  				if (maceratorItemStacks[p_70298_1_].stackSize == 0)
  				{
  					maceratorItemStacks[p_70298_1_] = null;
  				}
  
  				return itemstack;
  			}
  		}
  		else
  		{
  			return null;
  		}
  	}
  
  	/**
  	 * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem -
  	 * like when you close a workbench GUI.
  	 */
  	@Override
  	public ItemStack getStackInSlotOnClosing(int p_70304_1_)
  	{
  		if (maceratorItemStacks[p_70304_1_] != null)
  		{
  			ItemStack itemstack = maceratorItemStacks[p_70304_1_];
  			maceratorItemStacks[p_70304_1_] = null;
  			return itemstack;
  		}
  		else
  		{
  			return null;
  		}
  	}
  
  	/**
  	 * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).
  	 */
  	@Override
  	public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_)
  	{
  		maceratorItemStacks[p_70299_1_] = p_70299_2_;
  
  		if (p_70299_2_ != null && p_70299_2_.stackSize > this.getInventoryStackLimit())
  		{
  			p_70299_2_.stackSize = this.getInventoryStackLimit();
  		}
  	}
  
  	/**
  	 * Returns the name of the inventory
  	 */
  	@Override
  	public String getInventoryName()
  	{
  		return this.hasCustomInventoryName() ? field_145958_o : "container.macerator";
  	}
  
  	/**
  	 * Returns if the inventory is named
  	 */
  	@Override
  	public boolean hasCustomInventoryName()
  	{
  		return field_145958_o != null && field_145958_o.length() > 0;
  	}
  
  	public void func_145951_a(String p_145951_1_)
  	{
  		field_145958_o = p_145951_1_;
  	}
  
  	@Override
  	public void readFromNBT(NBTTagCompound nbt)
  	{
  		super.readFromNBT(nbt);
  		NBTTagList nbttaglist = nbt.getTagList("Items", 10);
  		maceratorItemStacks = new ItemStack[this.getSizeInventory()];
  
  		for (int i = 0; i < nbttaglist.tagCount(); ++i)
  		{
  			NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i);
  			byte b0 = nbttagcompound1.getByte("Slot");
  
  			if (b0 >= 0 && b0 < maceratorItemStacks.length)
  			{
  				maceratorItemStacks[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1);
  			}
  		}
  
  		power = nbt.getShort("Power");
  		maceratorCookTime = nbt.getShort("CookTime");
  
  		if (nbt.hasKey("CustomName", 8))
  		{
  			field_145958_o = nbt.getString("CustomName");
  		}
  	}
  
  	@Override
  	public void writeToNBT(NBTTagCompound nbt)
  	{
  		super.writeToNBT(nbt);
  		nbt.setShort("Power", (short)power);
  		nbt.setShort("CookTime", (short)maceratorCookTime);
  		NBTTagList nbttaglist = new NBTTagList();
  
  		for (int i = 0; i < maceratorItemStacks.length; ++i)
  		{
  			if (maceratorItemStacks[i] != null)
  			{
  				NBTTagCompound nbttagcompound1 = new NBTTagCompound();
  				nbttagcompound1.setByte("Slot", (byte)i);
  				maceratorItemStacks[i].writeToNBT(nbttagcompound1);
  				nbttaglist.appendTag(nbttagcompound1);
  			}
  		}
  
  		nbt.setTag("Items", nbttaglist);
  
  		if (this.hasCustomInventoryName())
  		{
  			nbt.setString("CustomName", field_145958_o);
  		}
  	}
  
  	/**
  	 * Returns the maximum stack size for a inventory slot.
  	 */
  	@Override
  	public int getInventoryStackLimit()
  	{
  		return 64;
  	}
  
  	/**
  	 * Returns an integer between 0 and the passed value representing how close the current item is to being completely
  	 * cooked
  	 */
  	@SideOnly(Side.CLIENT)
  	public int getCrushingProgressScaled(int i)
  	{
  		//Speed
  