Adds the ability to override the level in the IslandLevelCalculatedEvent

https://github.com/BentoBoxWorld/Level/issues/125
This commit is contained in:
tastybento 2020-01-24 17:06:30 -08:00
parent b6f4c15469
commit 1de94afe7e
2 changed files with 11 additions and 3 deletions

View File

@ -390,7 +390,7 @@ public class CalcIslandLevel {
* Set level
* @param level - level
*/
public void setLevel(int level) {
public void setLevel(long level) {
this.level.set(level);
}
/**

View File

@ -60,13 +60,22 @@ public class IslandLevelCalculatedEvent extends IslandBaseEvent {
return results.getLevel();
}
/**
* Overwrite the level. This level will be used instead of the calculated level.
* @param level - the level to set
*/
public void setLevel(long level) {
results.setLevel(level);
}
/**
* @return number of points required to next level
*/
public long getPointsToNextLevel() {
return results.getPointsToNextLevel();
}
/**
* @return a human readable report explaining how the calculation was made
*/
@ -95,5 +104,4 @@ public class IslandLevelCalculatedEvent extends IslandBaseEvent {
this.targetPlayer = targetPlayer;
}
}