for(ItemStack enchantedBook : enchantedBooks) {
Map bookMap = EnchantmentHelper.getEnchantments(enchantedBook);
Iterator bookEnchantIterator = bookMap.keySet().iterator();
while(bookEnchantIterator.hasNext()) {
Enchantment bookEnchant = Enchantment.enchantmentsList[((Integer)bookEnchantIterator.next()).intValue()];
if(bookEnchant.canApply(inputStack)) {
return new ItemStack[]{inputStack, enchantedBook};
}
}
}
// }