Fixed the "deprecated" messages for topten placeholders

This commit is contained in:
Florian CUNY 2019-11-23 15:19:56 +01:00
parent dae58b8dff
commit cc1cca1453
2 changed files with 2 additions and 2 deletions

View File

@ -31,7 +31,7 @@ public class TopTenNamePlaceholder implements PlaceholderReplacer {
@Override @Override
public String onReplace(User user) { public String onReplace(User user) {
level.logWarning("You are using a deprecated placeholder."); level.logWarning("You are using a deprecated placeholder.");
level.log("Please replace any occurrence of 'Level_" + gm.getDescription().getName().toLowerCase() + "-island-top-name-#'"); level.log("Please replace any occurrence of 'Level_" + gm.getDescription().getName().toLowerCase() + "-island-level-top-name-#'");
level.log("by 'Level_" + gm.getDescription().getName().toLowerCase() + "_top_name_#'"); level.log("by 'Level_" + gm.getDescription().getName().toLowerCase() + "_top_name_#'");
Collection<UUID> values = level.getTopTen().getTopTenList(gm.getOverWorld()).getTopTen().keySet(); Collection<UUID> values = level.getTopTen().getTopTenList(gm.getOverWorld()).getTopTen().keySet();
return values.size() < i ? "" : level.getPlayers().getName(values.stream().skip(i).findFirst().orElse(null)); return values.size() < i ? "" : level.getPlayers().getName(values.stream().skip(i).findFirst().orElse(null));

View File

@ -31,7 +31,7 @@ public class TopTenPlaceholder implements PlaceholderReplacer {
@Override @Override
public String onReplace(User user) { public String onReplace(User user) {
level.logWarning("You are using a deprecated placeholder."); level.logWarning("You are using a deprecated placeholder.");
level.log("Please replace any occurrence of 'Level_" + gm.getDescription().getName().toLowerCase() + "-island-top-value-#'"); level.log("Please replace any occurrence of 'Level_" + gm.getDescription().getName().toLowerCase() + "-island-level-top-value-#'");
level.log("by 'Level_" + gm.getDescription().getName().toLowerCase() + "_top_value_#'"); level.log("by 'Level_" + gm.getDescription().getName().toLowerCase() + "_top_value_#'");
Collection<Long> values = level.getTopTen().getTopTenList(gm.getOverWorld()).getTopTen().values(); Collection<Long> values = level.getTopTen().getTopTenList(gm.getOverWorld()).getTopTen().values();
return values.size() < i ? "" : values.stream().skip(i).findFirst().map(String::valueOf).orElse(""); return values.size() < i ? "" : values.stream().skip(i).findFirst().map(String::valueOf).orElse("");