Allow . in usernames

This commit is contained in:
Spottedleaf 2022-01-01 11:50:44 -08:00
parent 4bf2aef745
commit 3c5284dae9
1 changed files with 2 additions and 2 deletions

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Validate usernames
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 33a29890435d6065a2cc4f8e8bf8209c01d5d114..0df723378b49aecacc15400db4b5f56c87a965b3 100644
index 33a29890435d6065a2cc4f8e8bf8209c01d5d114..96593919db8b140e55fe1a120c2835b679771e92 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -230,10 +230,38 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
@ -21,7 +21,7 @@ index 33a29890435d6065a2cc4f8e8bf8209c01d5d114..0df723378b49aecacc15400db4b5f56c
+ for (int i = 0, len = in.length(); i < len; ++i) {
+ char c = in.charAt(i);
+
+ if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || (c == '_')) {
+ if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || (c == '_' || c == '.')) {
+ continue;
+ }
+