Skip to content

Commit

Permalink
Fix Launcher downgrading, because String sort
Browse files Browse the repository at this point in the history
  • Loading branch information
C0D3-M4513R committed Jan 22, 2024
1 parent e7c1363 commit 66f2432
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ configurations {

dependencies {
compileOnly 'org.jetbrains:annotations:23.0.0'
implementation 'org.kettingpowered:kettingcommon:2.1.2'
implementation 'org.kettingpowered:kettingcommon:2.2.0'
implementation 'com.google.code.gson:gson:2.10.1' //Used in Patcher
implementation 'me.tongfei:progressbar:0.10.0' //Used to display progress
transitive 'org.jline:jline-reader:3.21.0' //needed for progressbar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ abstract class GenerateLibs extends DefaultTask {
@OutputFile abstract RegularFileProperty getOutput()

GenerateLibs(){
outputs.upToDateWhen {false}
outputs.cacheIf {false}
output.convention(getProject().getLayout().getBuildDirectory().file("ketting_libraries.txt"))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,14 @@ public static void extractJarContent(@NotNull String from, @NotNull File to, boo

private void updateLauncher() throws Exception {
if ("dep-env".equals(Version)) return;
final List<MajorMinorPatchVersion<String>> launcherVersions = new MavenManifest(KettingConstants.KETTING_GROUP, ArtifactID).getDepVersions()
final List<MajorMinorPatchVersion<Integer>> launcherVersions = new MavenManifest(KettingConstants.KETTING_GROUP, ArtifactID).getDepVersions()
.stream()
.map(MajorMinorPatchVersion::parse)
.map(mmp->mmp.convertMMP(Integer::parseInt))
.sorted()
.toList();
if(Main.DEBUG) System.out.println(launcherVersions.stream().map(MajorMinorPatchVersion::toString).collect(Collectors.joining("\n")));
MajorMinorPatchVersion<String> version = MajorMinorPatchVersion.parse(Version);
MajorMinorPatchVersion<Integer> version = MajorMinorPatchVersion.parse(Version).convertMMP(Integer::parseInt);
final int index = launcherVersions.indexOf(version);
if (index<0) {
System.err.println("Using unrecognised Launcher version.");
Expand Down

0 comments on commit 66f2432

Please sign in to comment.