Don't special case 'invalid' usernames for UUIDs.

This commit is contained in:
md_5 2014-04-20 18:58:00 +10:00
parent c15d869440
commit 6e0b0a1b55

View File

@ -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<CraftPlayer> 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 :(