From 82913cc71b5dec714dabf9935cffcc9eff6f70e3 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sun, 20 Apr 2014 18:58:00 +1000 Subject: [PATCH] Don't special case 'invalid' usernames for UUIDs. By: md_5 --- .../src/main/java/org/bukkit/craftbukkit/CraftServer.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 9f404c1a45..c0ebdf1a8c 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -170,8 +170,6 @@ public final class CraftServer implements Server { private CraftIconCache icon; private boolean overrideAllCommandBlockCommands = false; private boolean unrestrictedAdvancements; - private final Pattern validUserPattern = Pattern.compile("^[a-zA-Z0-9_]{2,16}$"); - private final UUID invalidUserUUID = UUID.nameUUIDFromBytes("InvalidUsername".getBytes(Charsets.UTF_8)); private final List playerView; public int reloadCount; @@ -1246,11 +1244,6 @@ public final class CraftServer implements Server { public OfflinePlayer getOfflinePlayer(String name) { Validate.notNull(name, "Name cannot be null"); - // If the name given cannot ever be a valid username give a dummy return, for scoreboard plugins - if (!validUserPattern.matcher(name).matches()) { - return new CraftOfflinePlayer(this, new GameProfile(invalidUserUUID, name)); - } - OfflinePlayer result = getPlayerExact(name); if (result == null) { // This is potentially blocking :(