mirror of
https://github.com/BentoBoxWorld/Level.git
synced 2024-11-15 15:15:16 +01:00
Fix top10 placeholders (#110)
This commit is contained in:
parent
eba6e11ec9
commit
3edb12581d
@ -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));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user