
package com.zivilon.cinder_loe.mixins;

import com.zivilon.cinder_loe.potion.*;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import lotr.common.item.LOTRItemMug;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.EnumDifficulty;
import net.minecraft.potion.*;
import net.minecraft.util.*;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Overwrite;

import java.util.*;

@Mixin(LOTRItemMug.class)
public class MixinLOTRItemMug {
    @Shadow(remap = false)
    protected List<PotionEffect> potionEffects = new ArrayList<PotionEffect>();

    /**
     * @author Shinare
     * @reason Added amplifier value to brew effects
     */
    @Overwrite(remap = false)
    private List<PotionEffect> convertPotionEffectsForStrength(float strength) {
        List<PotionEffect> list = new ArrayList<PotionEffect>();
        for (int i = 0; i < this.potionEffects.size(); i++) {
            PotionEffect base = this.potionEffects.get(i);
            PotionEffect modified = new PotionEffect(base.getPotionID(), (int)(base.getDuration() * strength), base.getAmplifier());
            list.add(modified);
        }
        return list;
    }
}
