Buggy code:
public class RecipeHelper { public static boolean fillOrDrainInventoryTank ( IInventory inv , IFluidTank tank , int inputSlot , int outputSlot ) { } public static boolean matchItemStack ( IInventory inv , int matchSlot , ItemAbstractStack ic ) { } public static boolean matchShapedInventory ( IInventory inv , int startSlot , int endSlot , ItemAbstractStack [ ] ic ) { int uStartSlot = endSlot - ( ic . length ) ; if ( uStartSlot < 0 ) throw new RuntimeException ( ) ; for ( int sMove = 0 ; sMove <= uStartSlot ; ++ sMove ) { boolean flag = true ; for ( int i = startSlot + sMove ; i < ( ( startSlot + sMove ) + ( ic . length ) ) ; ++ i ) { <START_BUG> if ( ! ( RecipeHelper . matchItemStack ( inv , i , ic [ i ] ) ) ) { <END_BUG> flag = false ; break ; } } if ( flag ) return true ; } return false ; } public static boolean matchShapelessInventory ( IInventory inv , int startSlot , int endSlot , ItemAbstractStack [ ] ic ) { } public static boolean matchOutput ( IInventory inv , int outputSlot , ItemStack output ) { } public static boolean matchOutput ( IInventory inv , int startSlot , int endSlot , ItemStack output ) { } public static boolean matchOutput ( IInventory inv , int startSlot , int endSlot , ItemStack [ ] output ) { } private static int addIn ( boolean doAdd , IInventory inv , int outputSlot , ItemStack output ) { } public static void onInputItemStack ( EntityPlayer aPlayer ) { } public static void onInputItemStack ( IInventory inv , int slotSlot ) { } public static void onInputShapedInventory ( IInventory inv , int startSlot , int endSlot , ItemAbstractStack [ ] ic ) { } public static void onInputShaelessInventory ( IInventory inv , int startSlot , int endSlot , ItemAbstractStack [ ] ic ) { } public static void onOutputItemStack ( IInventory inv , int outputSlot , ItemStack output ) { } public static void onOutputShapelessStack ( IInventory inv , int startSlot , int endSlot , ItemStack output ) { } public static void onOutputShapelessStacks ( IInventory inv , int startSlot , int endSlot , ItemStack [ ] output ) { } public static boolean matchOutFluidStack ( IFluidTank tank , FluidStack stack ) { } public static FluidStack mixFluid ( FluidStack stack1 , FluidStack stack2 ) { } public static void onOutputFluidStack ( IFluidTank tank , FluidStack stack ) { } public static class FakeCraftingInventory extends InventoryCrafting { private final ItemStack [ ] itemstacks ; private int xSize ; private int ySize ; public static RecipeHelper . FakeCraftingInventory init ( Object ... recipe ) { } private FakeCraftingInventory ( int xSize , int ySize , ItemStack ... stacks ) { } public ItemStack getStackInRowAndColumn ( int x , int y ) { } public int getSizeInventory ( ) { } public ItemStack getStackInSlot ( int i ) { } public ItemStack decrStackSize ( int i , int size ) { } public ItemStack getStackInSlotOnClosing ( int i ) { } public void setInventorySlotContents ( int i , ItemStack itemstack ) { } public String getInventoryName ( ) { } public boolean hasCustomInventoryName ( ) { } public int getInventoryStackLimit ( ) { } public void markDirty ( ) { } public boolean isUseableByPlayer ( EntityPlayer player ) { } public void openInventory ( ) { } public void closeInventory ( ) { } public boolean isItemValidForSlot ( int i , ItemStack stack ) { } } private static class FakeInventory implements IInventory { private final ItemStack [ ] itemstacks ; private FakeInventory ( ItemStack [ ] stacks ) { } private FakeInventory ( IInventory inventory ) { } public int getSizeInventory ( ) { } public ItemStack getStackInSlot ( int i ) { } public ItemStack decrStackSize ( int i , int size ) { } public ItemStack getStackInSlotOnClosing ( int i ) { } public void setInventorySlotContents ( int i , ItemStack itemstack ) { } public String getInventoryName ( ) { } public boolean hasCustomInventoryName ( ) { } public int getInventoryStackLimit ( ) { } public void markDirty ( ) { } public boolean isUseableByPlayer ( EntityPlayer player ) { } public void openInventory ( ) { } public void closeInventory ( ) { } public boolean isItemValidForSlot ( int i , ItemStack stack ) { } } No newline ; at end ; of file ; }

Fix:
if ( ! ( RecipeHelper . matchItemStack ( inv , i , ic [ ( ( i - startSlot ) - sMove ) ] ) ) ) {