* @param itemStack The item stack to enchant
* @param level The level of enchantment
* @return Whether enchantments were successfully added
*/
public static boolean addRandomEnchantments(ItemStack itemStack, int level) {
VanillaMaterial material = (VanillaMaterial) itemStack.getMaterial();
Random random = GenericMath.getRandom();
if (!(material instanceof VanillaItemMaterial)) {
return false;
}
int enchantibility = ((VanillaItemMaterial) material).getEnchantability();