Industrial Revolution

Industrial Revolution

5M Downloads

ItemStack damage application cancelled

Linguardium opened this issue ยท 0 comments

commented

It seems you fail to check if itemstacks are your item types and thus you cancel ALL itemstack damage. my tools last forever.

your damage mixins should only apply to your item types. change

damage mixin:
        ItemStack stack = (ItemStack) (Object) this;
        extractEnergy(stack, amount);
        cir.cancel();

extract energy method:
        if (stack.getItem() instanceof IRModularArmor) {
            Energy.of(stack).extract(amount);
        }

to

damage mixin:
        ItemStack stack = (ItemStack) (Object) this;
        if (stack.getItem() instanceof IRModularArmor) {
                extractEnergy(stack, amount);
                cir.cancel();
        }

extract energy method:
            Energy.of(stack).extract(amount);