// Path: src/main/java/matgm50/twarden/item/ItemWardenArmor.java
// public class ItemWardenArmor extends ItemArmor implements ISpecialArmor, IVisDiscountGear {
// 
//     public ItemWardenArmor(int type) {
// 
//         super(ModItems.materialWarden, 3, type);
//         setCreativeTab(TWarden.tabTWarden);
//         setMaxStackSize(1);
// 
//     }
// 
//     @Override
//     public boolean getShareTag() {return true;}
// 
//     @Override
//     public boolean isBookEnchantable(ItemStack stack, ItemStack book) {return false;}
// 
//     @Override
//     public int getMaxDamage(ItemStack stack) {return 50;}
// 
//     @Override
//     public boolean isDamageable() {return false;}
// 
//     @Override
//     public EnumRarity getRarity(ItemStack par1ItemStack) {return EnumRarity.epic;}
// 
//     @Override
//     public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
// 
//         par3List.add(EnumChatFormatting.AQUA + StatCollector.translateToLocal("tooltip.wardenic.charge") + ": " + (par1ItemStack.getMaxDamage() - par1ItemStack.getItemDamage()) + "/" + par1ItemStack.getMaxDamage());
//         par3List.add(EnumChatFormatting.GOLD + StatCollector.translateToLocal("tooltip.wardenic.upgrade") + ": " + WardenicChargeHelper.getUpgrade(par1ItemStack).getQuote());
// 
//         super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4);
// 
//     }
// 
//     @Override
//     public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
// 
//         WardenicChargeHelper.getUpgrade(itemStack).onTick(world, player, itemStack);
// 
//         super.onArmorTick(world, player, itemStack);
// 
//     }
// 
//     @Override
//     public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) {
// 
//         if(armor.getItemDamage() != armor.getMaxDamage()) {
// 
//             return new ArmorProperties(0, getArmorMaterial().getDamageReductionAmount(slot) / 25D, 20);
// 
//         } else {
// 
//             return new ArmorProperties(0, 0, 0);
// 
//         }
// 
//     }
// 
//     @Override
//     public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) {return getArmorMaterial().getDamageReductionAmount(slot);}
// 
//     @Override
//     public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) {}
// 
//     @Override
//     public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) {return 5;}
// 
// }
// 
// Path: src/main/java/matgm50/twarden/item/ItemWardenWeapon.java
// public class ItemWardenWeapon extends Item {
// 
//     public ItemWardenWeapon() {
// 
//         super();
//         setUnlocalizedName(ItemLib.WARDEN_WEAPON_NAME);
//         setCreativeTab(TWarden.tabTWarden);
//         setMaxStackSize(1);
// 
//         setFull3D();
// 
//     }
// 
//     @Override
//     public boolean getShareTag() {return true;}
// 
//     @Override
//     public boolean isBookEnchantable(ItemStack stack, ItemStack book) {return false;}
// 
//     @Override
//     public int getMaxDamage(ItemStack stack) {return 50;}
// 
//     @Override
//     public boolean isDamageable() {return false;}
// 
//     @Override
//     public EnumRarity getRarity(ItemStack par1ItemStack) {return EnumRarity.epic;}
// 
//     @Override
//     public EnumAction getItemUseAction(ItemStack par1ItemStack) {return EnumAction.block;}
// 
//     @Override
//     public int getMaxItemUseDuration(ItemStack par1ItemStack) {return 72000;}
// 
//     @Override
//     public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
// 
//         par3List.add(EnumChatFormatting.AQUA + StatCollector.translateToLocal("tooltip.wardenic.charge") + ": " + (par1ItemStack.getMaxDamage() - par1ItemStack.getItemDamage()) + "/" + par1ItemStack.getMaxDamage());
//         par3List.add(EnumChatFormatting.GOLD + StatCollector.translateToLocal("tooltip.wardenic.upgrade") + ": " + WardenicChargeHelper.getUpgrade(par1ItemStack).getQuote());
// 
//         super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4);
// 
//     }
// 
//     @Override
//     public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) {
// 
//         if(stack.getItemDamage() != stack.getMaxDamage()) {
// 
//             DamageSource damageSource = new DamageSourceWarden("warden", player);
// 
//             entity.attackEntityFrom(damageSource, 5);
// 
//             WardenicChargeHelper.getUpgrade(stack).onAttack(stack, player, entity);
// 
//             stack.setItemDamage(stack.getItemDamage() + 1);
// 
//         }
// 
//         return super.onLeftClickEntity(stack, player, entity);
// 
//     }
// 
//     @Override
//     @SideOnly(Side.CLIENT)
//     public void registerIcons(IIconRegister register) {
// 
//         itemIcon = register.registerIcon(ModLib.ID.toLowerCase() + ":" + "wardensword");
// 
//     }
// 
// }


import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import matgm50.twarden.item.ItemWardenArmor;
import matgm50.twarden.item.ItemWardenWeapon;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
import net.minecraftforge.event.entity.living.LivingHurtEvent;
import java.util.Random;
package matgm50.twarden.util.wardenic;



/**
 * Created by MasterAbdoTGM50 on 7/16/2014.
 */

public class WardenicChargeEvents {

    private Random random = new Random();

    public static void init() {

        MinecraftForge.EVENT_BUS.register(new WardenicChargeEvents());

    }

    @SubscribeEvent
    public void onTick(LivingUpdateEvent event) {

        if(event.entity instanceof EntityPlayer) {

            EntityPlayer player = (EntityPlayer)event.entity;

            for(int i = 0; i < 5; i++) {

                if(player.getEquipmentInSlot(i) != null) {

// Path: src/main/java/matgm50/twarden/item/ItemWardenArmor.java
// public class ItemWardenArmor extends ItemArmor implements ISpecialArmor, IVisDiscountGear {
// 
//     public ItemWardenArmor(int type) {
// 
//         super(ModItems.materialWarden, 3, type);
//         setCreativeTab(TWarden.tabTWarden);
//         setMaxStackSize(1);
// 
//     }
// 
//     @Override
//     public boolean getShareTag() {return true;}
// 
//     @Override
//     public boolean isBookEnchantable(ItemStack stack, ItemStack book) {return false;}
// 
//     @Override
//     public int getMaxDamage(ItemStack stack) {return 50;}
// 
//     @Override
//     public boolean isDamageable() {return false;}
// 
//     @Override
//     public EnumRarity getRarity(ItemStack par1ItemStack) {return EnumRarity.epic;}
// 
//     @Override
//     public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
// 
//         par3List.add(EnumChatFormatting.AQUA + StatCollector.translateToLocal("tooltip.wardenic.charge") + ": " + (par1ItemStack.getMaxDamage() - par1ItemStack.getItemDamage()) + "/" + par1ItemStack.getMaxDamage());
//         par3List.add(EnumChatFormatting.GOLD + StatCollector.translateToLocal("tooltip.wardenic.upgrade") + ": " + WardenicChargeHelper.getUpgrade(par1ItemStack).getQuote());
// 
//         super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4);
// 
//     }
// 
//     @Override
//     public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
// 
//         WardenicChargeHelper.getUpgrade(itemStack).onTick(world, player, itemStack);
// 
//         super.onArmorTick(world, player, itemStack);
// 
//     }
// 
//     @Override
//     public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) {
// 
//         if(armor.getItemDamage() != armor.getMaxDamage()) {
// 
//             return new ArmorProperties(0, getArmorMaterial().getDamageReductionAmount(slot) / 25D, 20);
// 
//         } else {
// 
//             return new ArmorProperties(0, 0, 0);
// 
//         }
// 
//     }
// 
//     @Override
//     public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) {return getArmorMaterial().getDamageReductionAmount(slot);}
// 
//     @Override
//     public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) {}
// 
//     @Override
//     public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) {return 5;}
// 
// }
// 
// Path: src/main/java/matgm50/twarden/item/ItemWardenWeapon.java
// public class ItemWardenWeapon extends Item {
// 
//     public ItemWardenWeapon() {
// 
//         super();
//         setUnlocalizedName(ItemLib.WARDEN_WEAPON_NAME);
//         setCreativeTab(TWarden.tabTWarden);
//         setMaxStackSize(1);
// 
//         setFull3D();
// 
//     }
// 
//     @Override
//     public boolean getShareTag() {return true;}
// 
//     @Override
//     public boolean isBookEnchantable(ItemStack stack, ItemStack book) {return false;}
// 
//     @Override
//     public int getMaxDamage(ItemStack stack) {return 50;}
// 
//     @Override
//     public boolean isDamageable() {return false;}
// 
//     @Override
//     public EnumRarity getRarity(ItemStack par1ItemStack) {return EnumRarity.epic;}
// 
//     @Override
//     public EnumAction getItemUseAction(ItemStack par1ItemStack) {return EnumAction.block;}
// 
//     @Override
//     public int getMaxItemUseDuration(ItemStack par1ItemStack) {return 72000;}
// 
//     @Override
//     public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
// 
//         par3List.add(EnumChatFormatting.AQUA + StatCollector.translateToLocal("tooltip.wardenic.charge") + ": " + (par1ItemStack.getMaxDamage() - par1ItemStack.getItemDamage()) + "/" + par1ItemStack.getMaxDamage());
//         par3List.add(EnumChatFormatting.GOLD + StatCollector.translateToLocal("tooltip.wardenic.upgrade") + ": " + WardenicChargeHelper.getUpgrade(par1ItemStack).getQuote());
// 
//         super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4);
// 
//     }
// 
//     @Override
//     public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) {
// 
//         if(stack.getItemDamage() != stack.getMaxDamage()) {
// 
//             DamageSource damageSource = new DamageSourceWarden("warden", player);
// 
//             entity.attackEntityFrom(damageSource, 5);
// 
//             WardenicChargeHelper.getUpgrade(stack).onAttack(stack, player, entity);
// 
//             stack.setItemDamage(stack.getItemDamage() + 1);
// 
//         }
// 
//         return super.onLeftClickEntity(stack, player, entity);
// 
//     }
// 
//     @Override
//     @SideOnly(Side.CLIENT)
//     public void registerIcons(IIconRegister register) {
// 
//         itemIcon = register.registerIcon(ModLib.ID.toLowerCase() + ":" + "wardensword");
// 
//     }
// 
// }


// Path: src/main/java/matgm50/twarden/util/wardenic/WardenicChargeEvents.java
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import matgm50.twarden.item.ItemWardenArmor;
import matgm50.twarden.item.ItemWardenWeapon;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
import net.minecraftforge.event.entity.living.LivingHurtEvent;
import java.util.Random;

package matgm50.twarden.util.wardenic;



/**
 * Created by MasterAbdoTGM50 on 7/16/2014.
 */

public class WardenicChargeEvents {

    private Random random = new Random();

    public static void init() {

        MinecraftForge.EVENT_BUS.register(new WardenicChargeEvents());

    }

    @SubscribeEvent
    public void onTick(LivingUpdateEvent event) {

        if(event.entity instanceof EntityPlayer) {

            EntityPlayer player = (EntityPlayer)event.entity;

            for(int i = 0; i < 5; i++) {

                if(player.getEquipmentInSlot(i) != null) {

                    if(player.getEquipmentInSlot(i).getItem() instanceof ItemWardenArmor || player.getEquipmentInSlot(i).getItem() instanceof ItemWardenWeapon) {