Updated forge, did random stuff to the armour before realizing issues with armour calculations
This commit is contained in:
parent
b56bbef29e
commit
aa480af518
5 changed files with 194 additions and 8 deletions
|
@ -39,6 +39,8 @@ public class ItemLivingArmour extends ItemArmor implements ISpecialArmor, IMeshP
|
|||
{
|
||||
public static String[] names = { "helmet", "chest", "legs", "boots" };
|
||||
|
||||
public static final boolean useSpecialArmourCalculation = true;
|
||||
|
||||
//TODO: Save/delete cache periodically.
|
||||
public static Map<ItemStack, LivingArmour> armourMap = new HashMap<ItemStack, LivingArmour>();
|
||||
|
||||
|
@ -67,6 +69,18 @@ public class ItemLivingArmour extends ItemArmor implements ISpecialArmor, IMeshP
|
|||
}
|
||||
}
|
||||
|
||||
public double getRemainderForDamage(double damage, double plating) //TODO: Add plating, which shifts the damage
|
||||
{
|
||||
if (damage <= 0)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
double protectionAmount = 1 - Math.max(3, 15 - damage / 2) / 25; //This puts the base armour protection at vanilla iron level
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArmorProperties getProperties(EntityLivingBase player, ItemStack stack, DamageSource source, double damage, int slot)
|
||||
{
|
||||
|
@ -126,12 +140,6 @@ public class ItemLivingArmour extends ItemArmor implements ISpecialArmor, IMeshP
|
|||
{
|
||||
LivingArmourUpgrade upgrade = entry.getValue();
|
||||
remainder *= (1 - upgrade.getArmourProtection(player, source));
|
||||
|
||||
/*
|
||||
* Just as a side note, if one upgrade provides
|
||||
* upgrade.getArmourProtection(source) = 0.5, the
|
||||
* armour would have a diamond level protection
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue