diff --git a/worldguard-core/src/main/java/com/sk89q/worldguard/protection/util/DomainInputResolver.java b/worldguard-core/src/main/java/com/sk89q/worldguard/protection/util/DomainInputResolver.java index 4c8a00ff8..46d3afc99 100644 --- a/worldguard-core/src/main/java/com/sk89q/worldguard/protection/util/DomainInputResolver.java +++ b/worldguard-core/src/main/java/com/sk89q/worldguard/protection/util/DomainInputResolver.java @@ -43,6 +43,7 @@ public class DomainInputResolver implements Callable { private static final Pattern GROUP_PATTERN = Pattern.compile("(?i)^[G]:(.+)$"); + private static final int MAX_PLAYER_NAME_LENGTH = 16; /** * The policy for locating users. @@ -119,9 +120,14 @@ public DefaultDomain call() throws UnresolvedNamesException { } } - if (!namesToQuery.isEmpty()) { + // Paper rejects longer names with an exception, so leave them unresolved. + List validNames = namesToQuery.stream() + .filter(name -> name.length() <= MAX_PLAYER_NAME_LENGTH) + .toList(); + + if (!validNames.isEmpty()) { try { - for (Profile profile : profileService.findAllByName(namesToQuery)) { + for (Profile profile : profileService.findAllByName(validNames)) { namesToQuery.remove(profile.getName().toLowerCase()); domain.addPlayer(profile.getUniqueId()); }