From 719ea50d1a19417c706645766f8e91d5335835ca Mon Sep 17 00:00:00 2001 From: Liqueur Librazy Date: Tue, 11 Dec 2018 03:07:50 +0800 Subject: [PATCH] Use getRawSchemeSpecificPart to preserve escape characters in uri, fix #5236 (#5237) --- .../minecraftforge/fml/loading/FMLCommonLaunchHandler.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/minecraftforge/fml/loading/FMLCommonLaunchHandler.java b/src/main/java/net/minecraftforge/fml/loading/FMLCommonLaunchHandler.java index 632558b2c..d96f5faaf 100644 --- a/src/main/java/net/minecraftforge/fml/loading/FMLCommonLaunchHandler.java +++ b/src/main/java/net/minecraftforge/fml/loading/FMLCommonLaunchHandler.java @@ -72,10 +72,10 @@ public abstract class FMLCommonLaunchHandler try { Path path; final URI uri = resource.toURI(); - if (uri.getSchemeSpecificPart().contains("!")) { - path = Paths.get(new URI(uri.getSchemeSpecificPart().split("!")[0])); + if (uri.getRawSchemeSpecificPart().contains("!")) { + path = Paths.get(new URI(uri.getRawSchemeSpecificPart().split("!")[0])); } else { - path = Paths.get(new URI("file://"+uri.getSchemeSpecificPart().substring(0, uri.getSchemeSpecificPart().length()-className.length()))); + path = Paths.get(new URI("file://"+uri.getRawSchemeSpecificPart().substring(0, uri.getRawSchemeSpecificPart().length()-className.length()))); } LOGGER.debug(CORE, "Found JAR {} at path {}", jarName, path.toString()); return path;