Last active
July 6, 2022 22:42
-
-
Save JoshuaJB/e712df86104af51d05155ab87cf287ad to your computer and use it in GitHub Desktop.
Fix `Internal Exception: java.lang.IllegalStateException: Invalid characters in username` on offline servers with Spigot 1.19.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
index 2db69f9d..2d0dd14c 100644 | |
--- a/CraftBukkit-Patches/0030-Fire-PreLogin-Events-in-Offline-Mode.patch | |
+++ b/CraftBukkit-Patches/0030-Fire-PreLogin-Events-in-Offline-Mode.patch | |
@@ -55,6 +55,19 @@ index dbf5769bc..a780e30d3 100644 | |
} | |
} | |
+@@ -235,9 +262,9 @@ public class LoginListener implements PacketLoginInListener { | |
+ } | |
+ | |
+ public static boolean isValidUsername(String s) { | |
+- return s.chars().filter((i) -> { | |
+- return i <= 32 || i >= 127; | |
+- }).findAny().isEmpty(); | |
++ // Joshua start | |
++ return true; | |
++ // Joshua end | |
+ } | |
+ | |
+ @Override | |
@@ -280,40 +307,7 @@ public class LoginListener implements PacketLoginInListener { | |
return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To apply this, run spigot's
BuildTools.jar
to get Spigot 1.19,cd Spigot
,git apply disable-username-validation-craftbukkit-spigot.patch
, andjava -jar BuildTools.jar --dont-update
. The resultingspigot-1.19.jar
will then skip username validation, allowing for punctuation, unicode, spaces, etc in Minecraft servers in offline mode.