mirror of
https://github.com/packwiz/packwiz.git
synced 2025-10-14 06:54:32 +02:00
Merge duplicate getLoaders methods into single core method
This commit is contained in:
13
core/pack.go
13
core/pack.go
@@ -173,3 +173,16 @@ func (pack Pack) GetPackName() string {
|
||||
return pack.Name + "-" + pack.Version
|
||||
}
|
||||
}
|
||||
|
||||
func (pack Pack) GetLoaders() (loaders []string) {
|
||||
if _, hasQuilt := pack.Versions["quilt"]; hasQuilt {
|
||||
loaders = append(loaders, "quilt")
|
||||
loaders = append(loaders, "fabric") // Backwards-compatible; for now (could be configurable later)
|
||||
} else if _, hasFabric := pack.Versions["fabric"]; hasFabric {
|
||||
loaders = append(loaders, "fabric")
|
||||
}
|
||||
if _, hasForge := pack.Versions["forge"]; hasForge {
|
||||
loaders = append(loaders, "forge")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user