Skip to content

Commit c452a8f

Browse files
committed
Add some sanitizers for companion app version comparison
1 parent 62ee510 commit c452a8f

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ if (enableModernJavaSyntax.toBoolean()) {
235235
if (it.name in ["compileMcLauncherJava", "compilePatchedMcJava"]) {
236236
return
237237
}
238-
sourceCompatibility = 17 // for the IDE support
238+
sourceCompatibility = 8 // for the IDE support
239239
options.release.set(8)
240240

241241
javaCompiler.set(javaToolchains.compilerFor {

src/main/java/com/github/minecraft_ta/totaldebug/companionApp/CompanionApp.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ private void downloadCompanionApp(String version) {
350350

351351
TotalDebug.LOGGER.info("Successfully downloaded companion app version {}", version);
352352
} catch (IOException e) {
353-
TotalDebug.LOGGER.error("Unable to download and unzip file", e);
353+
TotalDebug.LOGGER.error("Unable to reach github. Does this release exist? " + version, e);
354354
}
355355
}
356356

@@ -534,6 +534,11 @@ private void loadNewestCompanionAppVersion() {
534534
}
535535

536536
private static boolean areVersionsCompatible(String totalDebugVersion, String companionAppVersion) {
537+
if (totalDebugVersion.contains("-")) // Dev environment
538+
totalDebugVersion = totalDebugVersion.substring(0, totalDebugVersion.indexOf("-"));
539+
if (companionAppVersion.startsWith("v")) // Migration
540+
companionAppVersion = companionAppVersion.substring(1);
541+
537542
String[] totalDebugVersionSplit = StringUtils.split(totalDebugVersion, '.');
538543
String[] companionAppVersionSplit = StringUtils.split(companionAppVersion, '.');
539544

0 commit comments

Comments
 (0)