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:
comp500
2023-02-14 16:10:06 +00:00
parent d667447a88
commit d38d279d98
9 changed files with 123 additions and 145 deletions

View File

@@ -10,9 +10,9 @@ type Updater interface {
// ParseUpdate takes an unparsed interface{} (as a map[string]interface{}), and returns an Updater for a mod file.
// This can be done using the mapstructure library or your own parsing methods.
ParseUpdate(map[string]interface{}) (interface{}, error)
// CheckUpdate checks whether there is an update for each of the mods in the given slice, for the given MC version,
// CheckUpdate checks whether there is an update for each of the mods in the given slice,
// called for all of the mods that this updater handles
CheckUpdate([]Mod, string, Pack) ([]UpdateCheck, error)
CheckUpdate([]Mod, Pack) ([]UpdateCheck, error)
// DoUpdate carries out the update previously queried in CheckUpdate, on each Mod's metadata,
// given pointers to Mods and the value of CachedState for each mod
DoUpdate([]*Mod, []interface{}) error