Support offline installation of OptiFine 1.17.1 H1 and later

This commit is contained in:
Glavo 2021-12-18 00:40:09 +08:00 committed by Yuhui Huang
parent e48bf012a6
commit 8025b8e24b

View File

@ -229,6 +229,7 @@ public final class OptiFineInstallTask extends Task<Version> {
try (FileSystem fs = CompressingUtils.createReadOnlyZipFileSystem(installer)) {
Path configClass = fs.getPath("Config.class");
if (!Files.exists(configClass)) configClass = fs.getPath("net/optifine/Config.class");
if (!Files.exists(configClass)) configClass = fs.getPath("notch/net/optifine/Config.class");
if (!Files.exists(configClass)) throw new IOException("Unrecognized installer");
ConstantPool pool = ConstantPoolScanner.parse(Files.readAllBytes(configClass), ConstantType.UTF8);
List<String> constants = new ArrayList<>();