package com.zivilon.cinder_loe.mixins;

import lotr.common.coremod.LOTRReplacedMethods;
import lotr.common.enchant.LOTREnchantmentHelper;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;

@Mixin(LOTRReplacedMethods.Enchants.class)
public class MixinLOTRReplacedMethods {

    /**
     * @author Keylime
     * @reason because Mixins complains
     */
    @Overwrite(remap = false)
    public static int getSpecialArmorProtection(int base, ItemStack[] armor, DamageSource source) {
        int i = base;
        i += LOTREnchantmentHelper.calcSpecialArmorSetProtection(armor, source);
        //i = MathHelper.clamp_int(i, -25, 25);
        return i;
    }
}
