mirror of
https://github.com/BentoBoxWorld/Level.git
synced 2024-11-23 18:45:17 +01:00
Fixes points to next level bug.
https://github.com/BentoBoxWorld/addon-level/issues/17
This commit is contained in:
parent
c8e753af16
commit
4c7a6a710c
2
pom.xml
2
pom.xml
@ -70,7 +70,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>world.bentobox</groupId>
|
<groupId>world.bentobox</groupId>
|
||||||
<artifactId>bentobox</artifactId>
|
<artifactId>bentobox</artifactId>
|
||||||
<version>FC-1</version>
|
<version>0.9.0-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -207,9 +207,7 @@ public class CalcIslandLevel {
|
|||||||
// Set final score
|
// Set final score
|
||||||
result.level = (result.rawBlockCount / addon.getSettings().getLevelCost()) - result.deathHandicap - island.getLevelHandicap();
|
result.level = (result.rawBlockCount / addon.getSettings().getLevelCost()) - result.deathHandicap - island.getLevelHandicap();
|
||||||
// Calculate how many points are required to get to the next level
|
// Calculate how many points are required to get to the next level
|
||||||
result.pointsToNextLevel = (addon.getSettings().getLevelCost() * (result.level + 1 + island.getLevelHandicap())) - (result.rawBlockCount - (result.deathHandicap * addon.getSettings().getDeathPenalty()));
|
result.pointsToNextLevel = addon.getSettings().getLevelCost() - (result.rawBlockCount % addon.getSettings().getLevelCost());
|
||||||
// Sometimes it will return 0, so calculate again to make sure it will display a good value
|
|
||||||
if(result.pointsToNextLevel == 0) result.pointsToNextLevel = (addon.getSettings().getLevelCost() * (result.level + 2 + island.getLevelHandicap()) - (result.rawBlockCount - (result.deathHandicap * addon.getSettings().getDeathPenalty())));
|
|
||||||
// Report
|
// Report
|
||||||
result.report = getReport();
|
result.report = getReport();
|
||||||
// All done.
|
// All done.
|
||||||
|
@ -71,7 +71,7 @@ public class PlayerLevel {
|
|||||||
}
|
}
|
||||||
// Send player how many points are required to reach next island level
|
// Send player how many points are required to reach next island level
|
||||||
if (results.getPointsToNextLevel() >= 0) {
|
if (results.getPointsToNextLevel() >= 0) {
|
||||||
asker.sendMessage("island.level.required-points-to-next-level", "[points]", String.valueOf(addon.getIslandLevel(world, targetPlayer)));
|
asker.sendMessage("island.level.required-points-to-next-level", "[points]", String.valueOf(results.getPointsToNextLevel()));
|
||||||
}
|
}
|
||||||
// Tell other team members
|
// Tell other team members
|
||||||
if (addon.getIslandLevel(world, targetPlayer) != oldLevel) {
|
if (addon.getIslandLevel(world, targetPlayer) != oldLevel) {
|
||||||
|
Loading…
Reference in New Issue
Block a user