mirror of
https://github.com/BentoBoxWorld/Challenges.git
synced 2024-12-30 21:07:47 +01:00
parent
aa0336d62a
commit
644c7d6ba5
@ -1677,6 +1677,21 @@ public class ChallengesManager
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns if the given level is last leve in given world.
|
||||
*
|
||||
* @param level the level
|
||||
* @param world the world
|
||||
* @return the boolean
|
||||
*/
|
||||
public boolean isLastLevel(ChallengeLevel level, World world)
|
||||
{
|
||||
List<ChallengeLevel> levels = this.getLevels(world);
|
||||
|
||||
return levels.get(levels.size() - 1) == level;
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
// Section: Challenges related methods
|
||||
// ---------------------------------------------------------------------
|
||||
|
@ -816,8 +816,9 @@ public abstract class CommonPanel
|
||||
// Get status in single string
|
||||
String status = "";
|
||||
// Get requirements in single string
|
||||
String waiver = this.user.getTranslationOrNothing(reference + "waiver",
|
||||
"[number]", String.valueOf(level.getWaiverAmount()));
|
||||
String waiver = this.manager.isLastLevel(level, this.world) ? "" :
|
||||
this.user.getTranslationOrNothing(reference + "waiver",
|
||||
"[number]", String.valueOf(level.getWaiverAmount()));
|
||||
// Get rewards in single string
|
||||
String rewards = this.generateReward(level);
|
||||
|
||||
@ -851,9 +852,11 @@ public abstract class CommonPanel
|
||||
// Get status in single string
|
||||
String status = this.generateLevelStatus(levelStatus);
|
||||
// Get requirements in single string
|
||||
String waiver = !levelStatus.isUnlocked() || levelStatus.isComplete() ? "" :
|
||||
this.user.getTranslationOrNothing(reference + "waiver",
|
||||
"[number]", String.valueOf(level.getWaiverAmount()));
|
||||
String waiver = this.manager.isLastLevel(level, this.world) ||
|
||||
!levelStatus.isUnlocked() ||
|
||||
levelStatus.isComplete() ?
|
||||
"" : this.user.getTranslationOrNothing(reference + "waiver",
|
||||
"[number]", String.valueOf(level.getWaiverAmount()));
|
||||
// Get rewards in single string
|
||||
String rewards = !levelStatus.isUnlocked() ? "" : this.generateReward(level);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user