Added a Repairing Living Armour Upgrade (trained by damaging the chestplate of the Living Armour while you have a full set on - it repairs all of your armour pieces over time)

Added the stat trackers for various Living Armour Downgrades.
This commit is contained in:
WayofTime 2016-10-04 17:10:27 -04:00
parent 6ea17510b7
commit 16a4857dfb
13 changed files with 545 additions and 13 deletions

View file

@ -41,6 +41,7 @@ import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
import WayofTime.bloodmagic.client.IMeshProvider;
import WayofTime.bloodmagic.item.ItemComponent;
import WayofTime.bloodmagic.livingArmour.LivingArmour;
import WayofTime.bloodmagic.livingArmour.tracker.StatTrackerRepairing;
import WayofTime.bloodmagic.livingArmour.upgrade.LivingArmourUpgradeElytra;
import WayofTime.bloodmagic.network.BloodMagicPacketHandler;
import WayofTime.bloodmagic.network.PlayerFallDistancePacketProcessor;
@ -233,6 +234,7 @@ public class ItemLivingArmour extends ItemArmor implements ISpecialArmor, IMeshP
{
if (this == ModItems.LIVING_ARMOUR_CHEST)
{
int preDamage = stack.getItemDamage();
if (source.isUnblockable())
{
return;
@ -252,6 +254,21 @@ public class ItemLivingArmour extends ItemArmor implements ISpecialArmor, IMeshP
}
stack.damageItem(damage, entity);
int receivedDamage = stack.getItemDamage() - preDamage;
if (entity instanceof EntityPlayer)
{
EntityPlayer player = (EntityPlayer) entity;
if (LivingArmour.hasFullSet(player))
{
LivingArmour armour = ItemLivingArmour.getLivingArmour(stack);
if (armour != null)
{
StatTrackerRepairing.incrementCounter(armour, receivedDamage);
}
}
}
} else
{
stack.damageItem(damage, entity);