Skip to content

Commit bb2073d

Browse files
committed
fix: 通过执行jar安装的版本不存在jar文件时启动失败
1 parent 134f178 commit bb2073d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

FCLCore/src/main/java/com/tungsten/fclcore/launch/DefaultLauncher.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,13 @@ private CommandBuilder generateCommandLine() throws IOException {
205205

206206
Set<String> classpath = repository.getClasspath(version);
207207
classpath.add(FCLPath.MIO_LAUNCH_WRAPPER);
208-
File jar = new File(repository.getVersionRoot(version.getId()), version.getId() + ".jar");
209-
// if (!jar.exists() || !jar.isFile())
210-
// throw new IOException("Minecraft jar does not exist");
208+
File jar = repository.getVersionJar(version);
209+
if (!jar.exists() || !jar.isFile()){
210+
String inherits = version.getInheritsFrom();
211+
if (!inherits.isEmpty()) {
212+
jar = repository.getVersionJar(inherits);
213+
}
214+
}
211215
classpath.add(jar.getAbsolutePath());
212216

213217
// Provided Minecraft arguments

0 commit comments

Comments
 (0)