From 35e879f970668d8050076313005a3d983dcb7c8c Mon Sep 17 00:00:00 2001 From: Pedro Date: Tue, 3 Nov 2026 16:08:42 +0100 Subject: [PATCH] Skip lookup of player names longer than 16 characters --- .../protection/util/DomainInputResolver.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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()); }