YATS/Forge Documentation
 All Classes Namespaces Files Functions Variables Enumerator Pages
net.minecraftforge.common.ISpecialArmor Interface Referenceabstract

Classes

class  ArmorProperties
 

Public Member Functions

ArmorProperties getProperties (EntityLiving player, ItemStack armor, DamageSource source, double damage, int slot)
 
abstract int getArmorDisplay (EntityPlayer player, ItemStack armor, int slot)
 
abstract void damageArmor (EntityLiving entity, ItemStack stack, DamageSource source, int damage, int slot)
 

Detailed Description

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

Member Function Documentation

abstract void net.minecraftforge.common.ISpecialArmor.damageArmor ( EntityLiving  entity,
ItemStack  stack,
DamageSource  source,
int  damage,
int  slot 
)
pure virtual

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
entityThe entity wearing the armor
stackThe ItemStack of the armor item itself.
sourceThe source of the damage, which can be used to alter armor properties based on the type or source of damage.
damageThe amount of damage being applied to the armor
slotThe armor slot the item is in.
abstract int net.minecraftforge.common.ISpecialArmor.getArmorDisplay ( EntityPlayer  player,
ItemStack  armor,
int  slot 
)
pure virtual

Get the displayed effective armor.

Parameters
playerThe player wearing the armor.
armorThe ItemStack of the armor item itself.
slotThe armor slot the item is in.
Returns
The number of armor points for display, 2 per shield.
ArmorProperties net.minecraftforge.common.ISpecialArmor.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
playerThe entity wearing the armor.
armorThe ItemStack of the armor item itself.
sourceThe source of the damage, which can be used to alter armor properties based on the type or source of damage.
damageThe total damage being applied to the entity
slotThe armor slot the item is in.
Returns
A ArmorProperties instance holding information about how the armor effects damage.

The documentation for this interface was generated from the following file: