diff --git a/common/src/main/java/me/lucko/luckperms/common/commands/misc/EditorCommand.java b/common/src/main/java/me/lucko/luckperms/common/commands/misc/EditorCommand.java index 152bdbb90..982093d3d 100644 --- a/common/src/main/java/me/lucko/luckperms/common/commands/misc/EditorCommand.java +++ b/common/src/main/java/me/lucko/luckperms/common/commands/misc/EditorCommand.java @@ -57,7 +57,7 @@ import java.util.Map; import java.util.UUID; public class EditorCommand extends SingleCommand { - public static final int MAX_USERS = 1000; + public static final int MAX_USERS = 500; public EditorCommand() { super(CommandSpec.EDITOR, "Editor", CommandPermission.EDITOR, Predicates.notInRange(0, 2)); @@ -145,7 +145,11 @@ public class EditorCommand extends SingleCommand { users.values().stream() .sorted(Comparator + // sort firstly by the users relative weight (depends on the groups they inherit) .comparingInt(u -> u.getCachedData().getMetaData(QueryOptions.nonContextual()).getWeight(MetaCheckEvent.Origin.INTERNAL)).reversed() + // then, prioritise users we actually have a username for + .thenComparing(u -> u.getUsername().isPresent(), ((Comparator) Boolean::compare).reversed()) + // then sort according to their username .thenComparing(User::getPlainDisplayName, String.CASE_INSENSITIVE_ORDER) ) .forEach(holders::add);