// Path: src/api/java/cofh/api/energy/IEnergyContainerItem.java
// public interface IEnergyContainerItem
// {
// 
//     /**
//      * Adds energy to an item. Returns the quantity of energy that was accepted. This should always return 0 if the item cannot be externally charged.
//      * 
//      * @param container
//      *            ItemStack to be charged.
//      * @param maxReceive
//      *            Maximum amount of energy to be sent into the item.
//      * @param simulate
//      *            If TRUE, the charge will only be simulated.
//      * @return Amount of energy that was (or would have been, if simulated) received by the item.
//      */
//     int receiveEnergy (ItemStack container, int maxReceive, boolean simulate);
// 
//     /**
//      * Removes energy from an item. Returns the quantity of energy that was removed. This should always return 0 if the item cannot be externally discharged.
//      * 
//      * @param container
//      *            ItemStack to be discharged.
//      * @param maxExtract
//      *            Maximum amount of energy to be extracted from the item.
//      * @param simulate
//      *            If TRUE, the discharge will only be simulated.
//      * @return Amount of energy that was (or would have been, if simulated) extracted from the item.
//      */
//     int extractEnergy (ItemStack container, int maxExtract, boolean simulate);
// 
//     /**
//      * Get the amount of energy currently stored in the item.
//      */
//     int getEnergyStored (ItemStack container);
// 
//     /**
//      * Get the max amount of energy that can be stored in the item.
//      */
//     int getMaxEnergyStored (ItemStack container);
// 
// }


import net.minecraft.block.BlockDispenser;
import net.minecraft.dispenser.IBehaviorDispenseItem;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import net.minecraftforge.common.ISpecialArmor;
import cofh.api.energy.IEnergyContainerItem;
                                                                                 // bug
                                                                                 // fix
                                                                                 // associated
                                                                                 // with
                                                                                 // fixed
                                                                                 // setCurrentItemOrArmor
                                                                                 // indexs
                                                                                 // for
                                                                                 // players.
            par1ItemStack.stackSize = 0;
        }

        return par1ItemStack;
    }

    // ISpecialArmor overrides
    @Override
    public ArmorProperties getProperties (EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot)
    {
        if (player.worldObj.isRemote)
        {
            return new ArmorProperties(0, 0, baseProtection);
        }
        NBTTagCompound tags = armor.getTagCompound();

        if (tags == null)
        {
            return new ArmorProperties(0, damage / baseProtection, baseProtection);
        }

// Path: src/api/java/cofh/api/energy/IEnergyContainerItem.java
// public interface IEnergyContainerItem
// {
// 
//     /**
//      * Adds energy to an item. Returns the quantity of energy that was accepted. This should always return 0 if the item cannot be externally charged.
//      * 
//      * @param container
//      *            ItemStack to be charged.
//      * @param maxReceive
//      *            Maximum amount of energy to be sent into the item.
//      * @param simulate
//      *            If TRUE, the charge will only be simulated.
//      * @return Amount of energy that was (or would have been, if simulated) received by the item.
//      */
//     int receiveEnergy (ItemStack container, int maxReceive, boolean simulate);
// 
//     /**
//      * Removes energy from an item. Returns the quantity of energy that was removed. This should always return 0 if the item cannot be externally discharged.
//      * 
//      * @param container
//      *            ItemStack to be discharged.
//      * @param maxExtract
//      *            Maximum amount of energy to be extracted from the item.
//      * @param simulate
//      *            If TRUE, the discharge will only be simulated.
//      * @return Amount of energy that was (or would have been, if simulated) extracted from the item.
//      */
//     int extractEnergy (ItemStack container, int maxExtract, boolean simulate);
// 
//     /**
//      * Get the amount of energy currently stored in the item.
//      */
//     int getEnergyStored (ItemStack container);
// 
//     /**
//      * Get the max amount of energy that can be stored in the item.
//      */
//     int getMaxEnergyStored (ItemStack container);
// 
// }


// Path: src/api/java/tconstruct/library/armor/ArmorCore.java
import net.minecraft.block.BlockDispenser;
import net.minecraft.dispenser.IBehaviorDispenseItem;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import net.minecraftforge.common.ISpecialArmor;
import cofh.api.energy.IEnergyContainerItem;

                                                                                 // bug
                                                                                 // fix
                                                                                 // associated
                                                                                 // with
                                                                                 // fixed
                                                                                 // setCurrentItemOrArmor
                                                                                 // indexs
                                                                                 // for
                                                                                 // players.
            par1ItemStack.stackSize = 0;
        }

        return par1ItemStack;
    }

    // ISpecialArmor overrides
    @Override
    public ArmorProperties getProperties (EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot)
    {
        if (player.worldObj.isRemote)
        {
            return new ArmorProperties(0, 0, baseProtection);
        }
        NBTTagCompound tags = armor.getTagCompound();

        if (tags == null)
        {
            return new ArmorProperties(0, damage / baseProtection, baseProtection);
        }

        NBTTagCompound data = tags.getCompoundTag(SET_NAME);