Skip to content

Commit

Permalink
refactor(legacy): Java detection only for first start (#5567)
Browse files Browse the repository at this point in the history
  • Loading branch information
MukjepScarlet authored Feb 8, 2025
1 parent d51c593 commit dd8e465
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
2 changes: 2 additions & 0 deletions src/main/java/net/ccbluex/liquidbounce/file/FileManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ object FileManager : MinecraftInstance, Iterable<FileConfig> by FILE_CONFIGS {
val backgroundShaderFile = File(dir, "userbackground.frag")

var firstStart = false
private set

var backedup = false
private set

val PRETTY_GSON: Gson = GsonBuilder().setPrettyPrinting().create()

Expand Down
24 changes: 14 additions & 10 deletions src/main/java/net/ccbluex/liquidbounce/utils/client/JavaVersion.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,17 @@ fun checkJavaVersion() {
}
// < Java 8u100, warn
update.toInt() < 100 -> {
SharedScopes.IO.launch {
MiscUtils.showMessageDialog(
title = "Warning",
message = "You are using an outdated version of Java 8 ($javaVersion).\n"
+ "This might cause unexpected bugs.\n"
+ "Please update it to 8u101+ or get a new one from $DOWNLOAD_PAGE.",
JOptionPane.WARNING_MESSAGE
)
MiscUtils.showURL(DOWNLOAD_PAGE)
if (LiquidBounce.fileManager.firstStart) {
SharedScopes.IO.launch {
MiscUtils.showMessageDialog(
title = "Warning",
message = "You are using an outdated version of Java 8 ($javaVersion).\n"
+ "This might cause unexpected bugs.\n"
+ "Please update it to 8u101+ or get a new one from $DOWNLOAD_PAGE.",
JOptionPane.WARNING_MESSAGE
)
MiscUtils.showURL(DOWNLOAD_PAGE)
}
}
}
}
Expand All @@ -57,7 +59,9 @@ fun checkJavaVersion() {
+ "You can get JRE 8 from $DOWNLOAD_PAGE.",
JOptionPane.WARNING_MESSAGE
)
MiscUtils.showURL(DOWNLOAD_PAGE)
if (LiquidBounce.fileManager.firstStart) {
MiscUtils.showURL(DOWNLOAD_PAGE)
}
}
}
}
Expand Down

0 comments on commit dd8e465

Please sign in to comment.