mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-21 20:52:34 +00:00
Fix jar file path detection if the path contains a "!" (#7790)
This commit is contained in:
1 parent
2a7dde3d2e
commit
84381553a9
1 file changed
+3
-2
@@ -54,8 +54,9 @@ public class LibraryFinder {
|
||||
try {
|
||||
Path path;
|
||||
final URI uri = resource.toURI();
|
||||
if (uri.getRawSchemeSpecificPart().contains("!")) {
|
||||
path = Paths.get(new URI(uri.getRawSchemeSpecificPart().split("!")[0]));
|
||||
if (uri.getScheme().equals("jar") && uri.getRawSchemeSpecificPart().contains("!/")) {
|
||||
int lastExcl = uri.getRawSchemeSpecificPart().lastIndexOf("!/");
|
||||
path = Paths.get(new URI(uri.getRawSchemeSpecificPart().substring(0, lastExcl)));
|
||||
} else {
|
||||
path = Paths.get(new URI("file://"+uri.getRawSchemeSpecificPart().substring(0, uri.getRawSchemeSpecificPart().length()-resourceName.length())));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user