Use FlexVer to get largest loader version (fixes Forge default version in init)

This commit is contained in:
comp500
2022-11-19 20:25:38 +00:00
parent 4f6528dcb5
commit 6160c2ac01
3 changed files with 7 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ package core
import (
"encoding/xml"
"errors"
"github.com/unascribed/FlexVer/go/flexver"
"strings"
)
@@ -93,6 +94,8 @@ func FetchMavenVersionPrefixedList(url string, friendlyName string) func(mcVersi
if hasPrefixSplitDash(out.Versioning.Latest, mcVersion) {
return allowedVersions, out.Versioning.Latest, nil
}
// Sort list to get largest version
flexver.VersionSlice(out.Versioning.Versions.Version).Sort()
return allowedVersions, allowedVersions[len(allowedVersions)-1], nil
}
}