2018-02-15 18:49:01 -08:00
|
|
|
package WayofTime.bloodmagic.livingArmour;
|
2015-12-02 21:30:54 -05:00
|
|
|
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
|
|
import net.minecraft.nbt.NBTTagCompound;
|
|
|
|
import net.minecraft.world.World;
|
|
|
|
|
2017-08-15 21:30:48 -07:00
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
public abstract class StatTracker {
|
2015-12-30 15:34:40 -05:00
|
|
|
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
|
2017-08-15 21:30:48 -07:00
|
|
|
*
|
|
|
|
* @param world World the player is in
|
|
|
|
* @param player The player that has the armour equipped
|
|
|
|
* @param livingArmour 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-04-02 10:10:49 -04:00
|
|
|
public abstract void onDeactivatedTick(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
|
|
|
|
2016-07-29 21:10:22 -07:00
|
|
|
/**
|
|
|
|
* Used to obtain the progress from the current level to the next level.
|
2017-08-15 21:30:48 -07:00
|
|
|
* <p>
|
2016-07-29 21:10:22 -07:00
|
|
|
* 0.0 being 0% - 1.0 being 100%.
|
2017-08-15 21:30:48 -07:00
|
|
|
*
|
|
|
|
* @param livingArmour The equipped LivingArmour
|
2016-07-29 21:10:22 -07:00
|
|
|
* @return the progress from the current level to the next level.
|
|
|
|
*/
|
2017-08-15 21:30:48 -07:00
|
|
|
public double getProgress(LivingArmour livingArmour, int currentLevel) {
|
2016-07-29 21:10:22 -07:00
|
|
|
return 1.0D;
|
|
|
|
}
|
|
|
|
|
2017-08-15 21:30:48 -07:00
|
|
|
public final boolean isDirty() {
|
2015-12-30 15:34:40 -05:00
|
|
|
return isDirty;
|
|
|
|
}
|
|
|
|
|
2017-08-15 21:30:48 -07:00
|
|
|
public final void markDirty() {
|
2015-12-30 15:34:40 -05:00
|
|
|
this.isDirty = true;
|
|
|
|
}
|
|
|
|
|
2017-08-15 21:30:48 -07:00
|
|
|
public final void resetDirty() {
|
2015-12-30 15:34:40 -05:00
|
|
|
this.isDirty = false;
|
|
|
|
}
|
2016-02-14 21:50:32 -05:00
|
|
|
|
|
|
|
public abstract boolean providesUpgrade(String key);
|
2016-09-30 16:49:56 -04:00
|
|
|
|
|
|
|
public abstract void onArmourUpgradeAdded(LivingArmourUpgrade upgrade);
|
2015-12-02 21:30:54 -05:00
|
|
|
}
|