Fabric Shield Lib

Fabric Shield Lib

3M Downloads

Add ItemStack context to `getCoolDownTicks` in shield item class

IMB11 opened this issue ยท 3 comments

commented

Would be useful for enchantments that affect cooldown ticks.

commented

Example:

@Override
    public int getCoolDownTicks(@Nullable ItemStack itemStack) {

        if (itemStack != null) {
            ... = itemStack.getEnchantments().getLevel(...);

            return super.getCoolDownTicks() * ...;
        }

        return super.getCoolDownTicks();
    }
    ```
commented

Yeah, looks good!
So I just need to change this line to public int getCoolDownTicks(@Nullable ItemStack itemStack) {?

commented

Done in 1.21.3 and 1.21.4 versions, not sure how far we'll backport.