Cleans up top ten list

This commit is contained in:
tastybento 2019-07-10 08:08:26 -07:00
parent 5adf2a3ef9
commit 4fe46bd1a9
1 changed files with 2 additions and 0 deletions

View File

@ -24,6 +24,8 @@ public class TopTenData implements DataObject {
private Map<UUID, Long> topTen = new LinkedHashMap<>();
public Map<UUID, Long> getTopTen() {
// Remove any entries that have level values less than 1
topTen.values().removeIf(l -> l < 1);
return topTen.entrySet().stream()
.sorted(Collections.reverseOrder(Map.Entry.comparingByValue())).limit(10)
.collect(Collectors.toMap(