net.minecraftforge.common
Interface ISpecialArmor


public interface ISpecialArmor

This interface is to be implemented by ItemArmor classes. It will allow to modify computation of damage and health loss. Computation will be called before the actual armor computation, which can then be cancelled.

See Also:
ItemArmor

Nested Class Summary
static class ISpecialArmor.ArmorProperties
           
 
Method Summary
 void damageArmor(EntityLiving entity, ItemStack stack, DamageSource source, int damage, int slot)
          Applies damage to the ItemStack.
 int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot)
          Get the displayed effective armor.
 ISpecialArmor.ArmorProperties getProperties(EntityLiving player, ItemStack armor, DamageSource source, double damage, int slot)
          Retrieves the modifiers to be used when calculating armor damage.
 

Method Detail

getProperties

ISpecialArmor.ArmorProperties getProperties(EntityLiving player,
                                            ItemStack armor,
                                            DamageSource source,
                                            double damage,
                                            int slot)
Retrieves the modifiers to be used when calculating armor damage. Armor will higher priority will have damage applied to them before lower priority ones. If there are multiple pieces of armor with the same priority, damage will be distributed between them based on there absorption ratio.

Parameters:
player - The entity wearing the armor.
armor - The ItemStack of the armor item itself.
source - The source of the damage, which can be used to alter armor properties based on the type or source of damage.
damage - The total damage being applied to the entity
slot - The armor slot the item is in.
Returns:
A ArmorProperties instance holding information about how the armor effects damage.

getArmorDisplay

int getArmorDisplay(EntityPlayer player,
                    ItemStack armor,
                    int slot)
Get the displayed effective armor.

Parameters:
player - The player wearing the armor.
armor - The ItemStack of the armor item itself.
slot - The armor slot the item is in.
Returns:
The number of armor points for display, 2 per shield.

damageArmor

void damageArmor(EntityLiving entity,
                 ItemStack stack,
                 DamageSource source,
                 int damage,
                 int slot)
Applies damage to the ItemStack. The mod is responsible for reducing the item durability and stack size. If the stack is depleted it will be cleaned up automatically.

Parameters:
entity - The entity wearing the armor
stack - The ItemStack of the armor item itself.
source - The source of the damage, which can be used to alter armor properties based on the type or source of damage.
damage - The amount of damage being applied to the armor
slot - The armor slot the item is in.