mirror of
https://github.com/BentoBoxWorld/Challenges.git
synced 2024-12-30 21:07:47 +01:00
Fix issue when Challenges were not sorted by order number.
This commit is contained in:
parent
dff3608aa3
commit
2bbb4e5c87
@ -689,8 +689,8 @@ public class ChallengesManager
|
|||||||
String worldName = Util.getWorld(world).getName();
|
String worldName = Util.getWorld(world).getName();
|
||||||
// TODO: Probably need to check also database.
|
// TODO: Probably need to check also database.
|
||||||
return this.challengeCacheData.values().stream().
|
return this.challengeCacheData.values().stream().
|
||||||
sorted(Comparator.comparing(Challenge::getOrder)).
|
|
||||||
filter(challenge -> challenge.getUniqueId().startsWith(worldName)).
|
filter(challenge -> challenge.getUniqueId().startsWith(worldName)).
|
||||||
|
sorted(Comparator.comparing(Challenge::getOrder)).
|
||||||
collect(Collectors.toList());
|
collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -705,6 +705,7 @@ public class ChallengesManager
|
|||||||
// Free Challenges hides under FREE level.
|
// Free Challenges hides under FREE level.
|
||||||
return this.getAllChallenges(world).stream().
|
return this.getAllChallenges(world).stream().
|
||||||
filter(challenge -> challenge.getLevel().equals(FREE)).
|
filter(challenge -> challenge.getLevel().equals(FREE)).
|
||||||
|
sorted(Comparator.comparing(Challenge::getOrder)).
|
||||||
collect(Collectors.toList());
|
collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -719,6 +720,7 @@ public class ChallengesManager
|
|||||||
return level.getChallenges().stream().
|
return level.getChallenges().stream().
|
||||||
map(this::getChallenge).
|
map(this::getChallenge).
|
||||||
filter(Objects::nonNull).
|
filter(Objects::nonNull).
|
||||||
|
sorted(Comparator.comparing(Challenge::getOrder)).
|
||||||
collect(Collectors.toList());
|
collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user