package com.lothrazar.cyclicmagic.component.workbench;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;

//to save code just extend vanilla workbench instead of remake
public class InventoryWorkbench extends InventoryCrafting {
  private IInventory tileEntity;
  private Container container;
  public InventoryWorkbench(Container eventHandlerIn, IInventory tileEntity) {
    super(eventHandlerIn, 3, 3);
    // TODO Auto-generated constructor stub
    this.tileEntity = tileEntity;
    container = eventHandlerIn;
  }
  @Override
  public int getSizeInventory() {
    return 9;
  }
  @Override
  public ItemStack getStackInSlot(int index) {
    return this.tileEntity.getStackInSlot(index);
  }
  @Override
  public void setInventorySlotContents(int index, ItemStack stack) {
    this.tileEntity.setInventorySlotContents(index, stack);
    this.container.onCraftMatrixChanged(this);
  }
}

@@ -807,24 +807,814 @@
 index);%0A  %7D%0A
+  /**%0A   * just like vanilla%0A   */%0A  @Override%0A  public ItemStack decrStackSize(int index, int count) %7B%0A    if (!this.getStackInSlot(index).isEmpty()) %7B%0A      ItemStack itemstack;%0A      if (this.getStackInSlot(index).getCount() %3C= count) %7B%0A        itemstack = this.getStackInSlot(index);%0A        this.setInventorySlotContents(index, ItemStack.EMPTY);%0A        this.container.onCraftMatrixChanged(this);%0A        return itemstack;%0A      %7D%0A      else %7B%0A        itemstack = this.getStackInSlot(index).splitStack(count);%0A        if (this.getStackInSlot(index).getCount() == 0) %7B%0A          this.setInventorySlotContents(index, ItemStack.EMPTY);%0A        %7D%0A        this.container.onCraftMatrixChanged(this);%0A        return itemstack;%0A      %7D%0A    %7D%0A    else %7B%0A      return ItemStack.EMPTY;%0A    %7D%0A  %7D%0A
   @Override%0A

fix crafting not drainin