public boolean matches(InventoryCrafting crafting,World world){
  final List<ItemStack> recipeList=new ArrayList<ItemStack>(this.recipeItems);
  for (int i=0; i < 3; ++i) {
    for (int j=0; j < 3; ++j) {
      final ItemStack actual=crafting.getStackInRowAndColumn(j,i);
      if (actual != null) {
        boolean flag=false;
        final Iterator<ItemStack> iterator=recipeList.iterator();
        while (iterator.hasNext()) {
          final ItemStack expected=iterator.next();
          if (comparator.equals(expected,actual)) {
            flag=true;
            recipeList.remove(expected);
            break;
          }
        }
        if (!flag) {
          return false;
        }
      }
    }
  }
  return recipeList.isEmpty();
}

public boolean matches ( InventoryCrafting crafting , World world ) { final List < ItemStack > recipeList = new ArrayList < ItemStack > ( this . recipeItems ) ; for ( int i = 0 ; i < 3 ; ++ i ) { for ( int j = 0 ; j < 3 ; ++ j ) { final ItemStack actual = crafting . getStackInRowAndColumn ( j , i ) ; if ( actual != null ) { boolean flag = false ; final Iterator < ItemStack > iterator = recipeList . iterator ( ) ; while ( iterator . hasNext ( ) ) { final ItemStack expected = iterator . next ( ) ; if ( comparator . equals ( expected , actual ) ) { flag = true ; recipeList . remove ( expected ) ; break ; } } if ( ! flag ) { return false ; } } } } return recipeList . isEmpty ( ) ; }
used to check if a recipe matches current crafting inventory
