Made it so that when you acquire a Living Armour Upgrade from a Tome, it raises the corresponding Stat Tracker up to that upgrade level.

This commit is contained in:
WayofTime 2016-09-30 16:49:56 -04:00
parent 7a42968633
commit d1a7a77034
24 changed files with 393 additions and 85 deletions

View file

@ -1,18 +1,18 @@
package WayofTime.bloodmagic.livingArmour.tracker;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
import WayofTime.bloodmagic.api.livingArmour.StatTracker;
import WayofTime.bloodmagic.livingArmour.LivingArmour;
import WayofTime.bloodmagic.livingArmour.upgrade.LivingArmourUpgradeGrimReaperSprint;
import WayofTime.bloodmagic.util.Utils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
public class StatTrackerGrimReaperSprint extends StatTracker
{
@ -114,4 +114,18 @@ public class StatTrackerGrimReaperSprint extends StatTracker
{
return key.equals(Constants.Mod.MODID + ".upgrade.grimReaper");
}
@Override
public void onArmourUpgradeAdded(LivingArmourUpgrade upgrade)
{
if (upgrade instanceof LivingArmourUpgradeGrimReaperSprint)
{
int level = upgrade.getUpgradeLevel();
if (level < deathsRequired.length)
{
totalDeaths = Math.max(totalDeaths, deathsRequired[level]);
this.markDirty();
}
}
}
}