From 3edb12581d70ba4356e7ef34f2f4781c362a7c6a Mon Sep 17 00:00:00 2001 From: Gabriele C Date: Tue, 24 Dec 2019 15:45:28 +0100 Subject: [PATCH] Fix top10 placeholders (#110) --- src/main/java/world/bentobox/level/Level.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/world/bentobox/level/Level.java b/src/main/java/world/bentobox/level/Level.java index a744427..876a58d 100644 --- a/src/main/java/world/bentobox/level/Level.java +++ b/src/main/java/world/bentobox/level/Level.java @@ -177,7 +177,7 @@ public class Level extends Addon { gm.getDescription().getName().toLowerCase() + "_top_value_" + rank, user -> { Collection 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 @@ -185,7 +185,7 @@ public class Level extends Addon { gm.getDescription().getName().toLowerCase() + "_top_name_" + rank, user -> { Collection 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)); }); } }