@@ -0,0 +1,2240 @@
+package net.darkhax.bookshelf.api.util;%0A%0Aimport net.minecraft.world.entity.Entity;%0Aimport net.minecraft.world.entity.LivingEntity;%0Aimport net.minecraft.world.entity.MobType;%0Aimport net.minecraft.world.item.ItemStack;%0Aimport net.minecraft.world.item.enchantment.EnchantmentHelper;%0A%0A/**%0A * This class contains static helper methods for working with ItemStacks.%0A */%0Apublic final class ItemStackHelper %7B%0A%0A    /**%0A     * Calculates the attack damage for an ItemStack when used to attack an unspecified mob. This will include bonus%0A     * damage sources such as modifiers and enchantments.%0A     *%0A     * @param stack The ItemStack to calculate the damage value of.%0A     * @return The attack damage for an ItemStack with bonus damage modifiers applied.%0A     */%0A    public static double getAttackDamage(ItemStack stack) %7B%0A%0A        return getAttackDamage(stack, MobType.UNDEFINED);%0A    %7D%0A%0A    /**%0A     * Calculates the attack damage for an ItemStack when used to attack a specific entity. This will include bonus%0A     * damage sources such as attribute modifiers and enchantments.%0A     *%0A     * @param stack  The ItemStack to calculate the damage value of.%0A     * @param target The target entity being attacked.%0A     * @return The attack damage for an ItemStack with bonus damage modifiers applied.%0A     */%0A    public static double getAttackDamage(ItemStack stack, Entity target) %7B%0A%0A        return getAttackDamage(stack, (target instanceof LivingEntity living) ? living.getMobType() : MobType.UNDEFINED);%0A    %7D%0A%0A    /**%0A     * Calculates the attack damage for an ItemStack after accounting for bonus damage modifiers such as attribute%0A     * modifiers and enchantments.%0A     *%0A     * @param stack      The ItemStack to calculate the damage value of.%0A     * @param targetType The type of mob being attacked. Used for some enchantment calculations.%0A     * @return The attack damage for an ItemStack with bonus damage modifiers applied.%0A     */%0A    public static double getAttackDamage(ItemStack stack, MobType targetType) %7B%0A%0A        final double damage = AttributeHelper.getAttackDamage(stack);%0A        final double bonusEnchantmentDamage = EnchantmentHelper.getDamageBonus(stack, targetType);%0A%0A        return damage + bonusEnchantmentDamage;%0A    %7D%0A%7D%0A

Add helper for working with ItemStacks.