Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(legacy): Java detection only for first start #5567

Merged
merged 1 commit into from
Feb 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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