From 2f78acf526fdb71d2b51779b208e47f03fe263d5 Mon Sep 17 00:00:00 2001 From: SashegDev Date: Thu, 13 Aug 2026 14:09:22 +0000 Subject: [PATCH] =?UTF-8?q?v1.0.15.2=20=E2=80=94=20fix=20launcher=20'no=20?= =?UTF-8?q?packs=20available'=20(NPE=20uri=20is=20null=20in=20sendBounded)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sashegdev/zernmc/launcher/utils/ZHttpClient.java | 2 +- .../integration/ForgeInstallIntegrationTest.java | 10 ++++++++-- launcher/pom.xml | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/launcher/launcher/src/main/java/sashegdev/zernmc/launcher/utils/ZHttpClient.java b/launcher/launcher/src/main/java/sashegdev/zernmc/launcher/utils/ZHttpClient.java index 45f866f..e50108b 100644 --- a/launcher/launcher/src/main/java/sashegdev/zernmc/launcher/utils/ZHttpClient.java +++ b/launcher/launcher/src/main/java/sashegdev/zernmc/launcher/utils/ZHttpClient.java @@ -309,7 +309,7 @@ public class ZHttpClient { * The request-level .timeout(Duration) bounds the actual network I/O. */ private static HttpResponse sendBounded(HttpRequest request, HttpResponse.BodyHandler handler, long timeoutSeconds) throws IOException, InterruptedException { - HttpRequest timed = request.newBuilder() + HttpRequest timed = HttpRequest.newBuilder(request, (name, value) -> true) .timeout(Duration.ofSeconds(timeoutSeconds)) .build(); return client.send(timed, handler); diff --git a/launcher/launcher/src/test/java/me/sashegdev/zernmc/launcher/integration/ForgeInstallIntegrationTest.java b/launcher/launcher/src/test/java/me/sashegdev/zernmc/launcher/integration/ForgeInstallIntegrationTest.java index 176970e..22c101b 100644 --- a/launcher/launcher/src/test/java/me/sashegdev/zernmc/launcher/integration/ForgeInstallIntegrationTest.java +++ b/launcher/launcher/src/test/java/me/sashegdev/zernmc/launcher/integration/ForgeInstallIntegrationTest.java @@ -119,8 +119,14 @@ class ForgeInstallIntegrationTest { List command = builder.build(options); // === JVM args checks === - assertFalse(command.contains("-cp"), - "Forge must NOT have -cp (causes split-package)"); + // Real Forge version.json (1.20.1-47.x) has no -cp, so the launcher adds it + assertTrue(command.contains("-cp"), + "Launcher must add -cp for Forge (version.json has none)"); + int cpIdx = command.indexOf("-cp"); + assertTrue(cpIdx + 1 < command.size(), "-cp must have a value"); + String classpath = command.get(cpIdx + 1); + assertNotNull(classpath, "-cp value must not be null"); + assertFalse(classpath.contains("${classpath}"), "-cp must not contain unresolved ${classpath} placeholder"); // Find -Djava.library.path (added manually, not from forge child) String libPath = null; diff --git a/launcher/pom.xml b/launcher/pom.xml index 25b0334..fff79fa 100644 --- a/launcher/pom.xml +++ b/launcher/pom.xml @@ -19,7 +19,7 @@ 1.0.15 - 1 + 2 21 21 UTF-8