mirror of
https://github.com/packwiz/packwiz.git
synced 2025-11-19 01:24:32 +01:00
Prefer game versions according to acceptable versions list (fixes #181)
The acceptable versions list should now be specified in order of preference, where the last version is the most preferable Minecraft version
This commit is contained in:
10
core/pack.go
10
core/pack.go
@@ -164,6 +164,16 @@ func (pack Pack) GetMCVersion() (string, error) {
|
||||
return mcVersion, nil
|
||||
}
|
||||
|
||||
// GetSupportedMCVersions gets the versions of Minecraft this pack allows in downloaded mods, ordered by preference (highest = most desirable)
|
||||
func (pack Pack) GetSupportedMCVersions() ([]string, error) {
|
||||
mcVersion, ok := pack.Versions["minecraft"]
|
||||
if !ok {
|
||||
return nil, errors.New("no minecraft version specified in modpack")
|
||||
}
|
||||
allVersions := append(append([]string(nil), viper.GetStringSlice("acceptable-game-versions")...), mcVersion)
|
||||
return allVersions, nil
|
||||
}
|
||||
|
||||
func (pack Pack) GetPackName() string {
|
||||
if pack.Name == "" {
|
||||
return "export"
|
||||
|
||||
Reference in New Issue
Block a user