2015-12-02 21:30:54 -05:00
|
|
|
package WayofTime.bloodmagic.api.livingArmour;
|
|
|
|
|
2016-01-02 22:04:51 -05:00
|
|
|
import java.util.List;
|
|
|
|
|
2015-12-02 21:30:54 -05:00
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
|
|
import net.minecraft.nbt.NBTTagCompound;
|
|
|
|
import net.minecraft.world.World;
|
|
|
|
import WayofTime.bloodmagic.livingArmour.LivingArmour;
|
|
|
|
|
2015-12-30 15:34:40 -05:00
|
|
|
public abstract class StatTracker
|
|
|
|
{
|
|
|
|
private boolean isDirty = false;
|
|
|
|
|
|
|
|
public abstract String getUniqueIdentifier();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* When called the StatTracker should reset all of its data, including
|
|
|
|
* upgrades.
|
|
|
|
*/
|
|
|
|
public abstract void resetTracker();
|
|
|
|
|
|
|
|
public abstract void readFromNBT(NBTTagCompound tag);
|
|
|
|
|
|
|
|
public abstract void writeToNBT(NBTTagCompound tag);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Called each tick to update the tracker's information. Called in
|
|
|
|
* LivingArmour
|
|
|
|
*
|
|
|
|
* @param world
|
2016-01-02 17:56:37 -05:00
|
|
|
* World the player is in
|
2015-12-30 15:34:40 -05:00
|
|
|
* @param player
|
2016-01-02 17:56:37 -05:00
|
|
|
* The player that has the armour equipped
|
2015-12-30 15:34:40 -05:00
|
|
|
* @param livingArmour
|
2016-01-02 17:56:37 -05:00
|
|
|
* The equipped LivingArmour
|
2015-12-30 15:34:40 -05:00
|
|
|
* @return True if there is a new upgrade unlocked this tick.
|
|
|
|
*/
|
|
|
|
public abstract boolean onTick(World world, EntityPlayer player, LivingArmour livingArmour);
|
|
|
|
|
2016-01-02 22:04:51 -05:00
|
|
|
public abstract List<LivingArmourUpgrade> getUpgrades();
|
2015-12-30 15:34:40 -05:00
|
|
|
|
|
|
|
public final boolean isDirty()
|
|
|
|
{
|
|
|
|
return isDirty;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final void markDirty()
|
|
|
|
{
|
|
|
|
this.isDirty = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final void resetDirty()
|
|
|
|
{
|
|
|
|
this.isDirty = false;
|
|
|
|
}
|
2015-12-02 21:30:54 -05:00
|
|
|
}
|