Store your Minecraft configs with your other dotfiles, and load it automatically.
at main 652 B view raw
1package modrinth 2 3import ( 4 "strconv" 5 6 "github.com/charmbracelet/log" 7) 8 9func LoadMods(mods map[string]string) []Project { 10 var modProjects []Project 11 log.Info("Loading " + strconv.Itoa(len(mods)) + " mods") 12 for name, id := range mods { 13 project := fetchProject(name, id) 14 if (project == nil) { 15 log.Warn("Unable to find mod project, skipping...", "name", name, "id", id) 16 continue 17 } 18 if (project.ProjectType != "mod") { 19 log.Warn("Project is not a mod, skipping...", "name", name, "id", id) 20 continue 21 } 22 log.Info("Loaded mod project", "name", name, "id", id) 23 modProjects = append(modProjects, *project) 24 } 25 return modProjects 26} 27 28