diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/misc/SearchCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/misc/SearchCommand.java index 70a45065..6fe7c30e 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/misc/SearchCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/misc/SearchCommand.java @@ -72,8 +72,8 @@ public class SearchCommand extends SingleCommand { Map uuidLookups = new HashMap<>(); Function lookupFunc = uuid -> uuidLookups.computeIfAbsent(uuid, u -> { String s = plugin.getStorage().getName(u).join(); - if (s == null) { - s = "null"; + if (s == null || s.isEmpty() || s.equals("null")) { + s = u.toString(); } return s; }); diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/utils/Util.java b/common/src/main/java/me/lucko/luckperms/common/commands/utils/Util.java index 3b87579d..82a81c5c 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/utils/Util.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/utils/Util.java @@ -281,13 +281,15 @@ public class Util { int index = pageNumber - 1; List>> pages = divideList(sorted, 15); - if ((index < 0 || index >= pages.size())) { + if (index < 0 || index >= pages.size()) { pageNumber = 1; index = 0; } List> page = pages.get(index); - List>> uuidMappedPage = page.stream().map(hp -> Maps.immutableEntry(uuidLookup.apply(hp.getHolder()), hp)).collect(Collectors.toList()); + List>> uuidMappedPage = page.stream() + .map(hp -> Maps.immutableEntry(uuidLookup.apply(hp.getHolder()), hp)) + .collect(Collectors.toList()); FancyMessage message = new FancyMessage(""); String title = "&7(page &f" + pageNumber + "&7 of &f" + pages.size() + "&7 - &f" + sorted.size() + "&7 entries)"; @@ -316,7 +318,7 @@ public class Util { int index = pageNumber - 1; List>> pages = divideList(sorted, 15); - if ((index < 0 || index >= pages.size())) { + if (index < 0 || index >= pages.size()) { pageNumber = 1; index = 0; }