Skip to content

Commit 1ce351d

Browse files
committed
feat: quit app when auto update check failed
1 parent ae8ce82 commit 1ce351d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

java21/src/main/java/org/leavesmc/leavesclip/update/AutoUpdate.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,25 +35,25 @@ public static void init() {
3535
autoUpdateCorePath = firstLine;
3636
File jarFile = new File(autoUpdateCorePath);
3737
if (!jarFile.isFile() || !jarFile.exists()) {
38-
logger.warn("The specified server core: {} does not exist. Using the original jar!", autoUpdateCorePath);
39-
return;
38+
logger.error("The specified server core: {} does not exist!", autoUpdateCorePath);
39+
System.exit(1);
4040
}
4141

4242
useAutoUpdateJar = true;
4343

44-
if (!detectionLeavesclipVersion(autoUpdateCorePath)) {
45-
logger.warn("Leavesclip version detection in server core: {} failed. Using the original jar!", autoUpdateCorePath);
46-
useAutoUpdateJar = false;
47-
return;
44+
if (!detectionLeavesclipVersion()) {
45+
logger.error("Leavesclip version detection in server core: {} failed!", autoUpdateCorePath);
46+
System.exit(1);
4847
}
4948

5049
logger.info("Using server core: {}", autoUpdateCorePath);
5150
} catch (IOException e) {
5251
logger.error("Failed to read core path file.\n", e);
52+
System.exit(1);
5353
}
5454
}
5555

56-
private static boolean detectionLeavesclipVersion(String jarPath) {
56+
private static boolean detectionLeavesclipVersion() {
5757
if (Boolean.getBoolean("leavesclip.skip-leavesclip-version-check")) {
5858
return true;
5959
}

0 commit comments

Comments
 (0)