Fix top10 placeholders (#110)

This commit is contained in:
Gabriele C 2019-12-24 15:45:28 +01:00 committed by Florian CUNY
parent eba6e11ec9
commit 3edb12581d

View File

@ -177,7 +177,7 @@ public class Level extends Addon {
gm.getDescription().getName().toLowerCase() + "_top_value_" + rank, gm.getDescription().getName().toLowerCase() + "_top_value_" + rank,
user -> { user -> {
Collection<Long> values = getTopTen().getTopTenList(gm.getOverWorld()).getTopTen().values(); Collection<Long> values = getTopTen().getTopTenList(gm.getOverWorld()).getTopTen().values();
return values.size() < rank ? "" : values.stream().skip(rank).findFirst().map(String::valueOf).orElse(""); return values.size() < rank ? "" : values.stream().skip(rank - 1).findFirst().map(String::valueOf).orElse("");
}); });
// Name // Name
@ -185,7 +185,7 @@ public class Level extends Addon {
gm.getDescription().getName().toLowerCase() + "_top_name_" + rank, gm.getDescription().getName().toLowerCase() + "_top_name_" + rank,
user -> { user -> {
Collection<UUID> values = getTopTen().getTopTenList(gm.getOverWorld()).getTopTen().keySet(); Collection<UUID> values = getTopTen().getTopTenList(gm.getOverWorld()).getTopTen().keySet();
return values.size() < rank ? "" : getPlayers().getName(values.stream().skip(rank).findFirst().orElse(null)); return values.size() < rank ? "" : getPlayers().getName(values.stream().skip(rank - 1).findFirst().orElse(null));
}); });
} }
} }