public abstract class AbstractPassiveSkill
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private long |
exp
The current experience in this skill.
|
private int |
level
The current level of this skill.
|
Constructor and Description |
---|
AbstractPassiveSkill()
Creates an empty instance of this passive skill.
|
AbstractPassiveSkill(long exp)
Creates a new instance of this passive skill.
|
Modifier and Type | Method and Description |
---|---|
long |
getExp() |
abstract AbstractPassiveSkill |
getInstance(long exp)
Creates a new instance of this passive skill.
|
int |
getLevel() |
protected abstract java.util.List<java.lang.Long> |
getMilestones()
Gets all experience milestones, marking where new levels are reached.
|
java.lang.Long |
getNextMilestone() |
abstract java.lang.String |
getPassiveName()
Gets the name of the passive skill.
|
void |
grantExperience(org.bukkit.entity.Player player,
long earned)
Adds experience to the passive and levels it up, if a new milestone was reached.
|
protected boolean |
hasReachedMilestone() |
protected abstract void |
onLevelUp(org.bukkit.entity.Player player)
Method that gets called when a new milestone has been reached.
|
private int level
private long exp
public AbstractPassiveSkill()
public AbstractPassiveSkill(long exp)
exp
- The current experience in this skill.public abstract AbstractPassiveSkill getInstance(long exp)
exp
- The current experience in this skill.public abstract java.lang.String getPassiveName()
public int getLevel()
public long getExp()
public void grantExperience(org.bukkit.entity.Player player, long earned)
player
- The player that should see level up messages.earned
- The amount of experience that has been earned.public java.lang.Long getNextMilestone()
protected boolean hasReachedMilestone()
protected abstract java.util.List<java.lang.Long> getMilestones()
protected abstract void onLevelUp(org.bukkit.entity.Player player)
player
- The player who reached the milestone.