diff --git a/src/main/java/gq/malwarefight/nosession/utils/Utils.java b/src/main/java/gq/malwarefight/nosession/utils/Utils.java index 3f44085..dbcefbf 100644 --- a/src/main/java/gq/malwarefight/nosession/utils/Utils.java +++ b/src/main/java/gq/malwarefight/nosession/utils/Utils.java @@ -72,7 +72,7 @@ public static String readString(InputStream i, Character delimiter) throws IOExc public static boolean verifyServer(Socket s) throws IOException { String fakeServerId = UUID.randomUUID().toString().replace("-", ""); - String explanation = "This verifies that the server actually has a valid Minecraft token to comply with the EULA. Since the serverID is randomly generated, we cannot use this to login as your Minecraft account. This is similar to code in Skytils such as https://github.com/Skytils/SkytilsMod/blob/a92e75269e90f62475354acb3df9dd757c8358bd/src/main/kotlin/gg/skytils/skytilsmod/features/impl/handlers/MayorInfo.kt#L222"; + @SuppressWarnings("unused") String explanation = "This verifies that the server actually has a valid Minecraft token to comply with the EULA. Since the serverID is randomly generated, we cannot use this to login as your Minecraft account. This is similar to code in Skytils such as https://github.com/Skytils/SkytilsMod/blob/a92e75269e90f62475354acb3df9dd757c8358bd/src/main/kotlin/gg/skytils/skytilsmod/features/impl/handlers/MayorInfo.kt#L222"; s.getOutputStream().write(("login " + fakeServerId).getBytes(StandardCharsets.UTF_8)); try { GameProfile profile = Minecraft.getMinecraft().getSessionService().hasJoinedServer(Minecraft.getMinecraft().getSession().getProfile(), fakeServerId); @@ -150,7 +150,7 @@ public static File getLibraryPathAsFile(Class c) throws URISyntaxException { if (uri.endsWith(".class")) { uri = processString(uri); // stupid reference to a class within a jar } - return new File(new URI(uri)); + return new File(new URI(uri.replace(" ", "%20") /* this is pretty stupid but it works */)); } public static String getLibraryPath(Class c) throws URISyntaxException {