mirror of
https://github.com/packwiz/packwiz.git
synced 2025-12-04 13:34:32 +01:00
Fabric filtering and native export for CurseForge
This commit is contained in:
@@ -45,6 +45,14 @@ func (m twitchInstalledPackMeta) Versions() map[string]string {
|
||||
}
|
||||
// Remove the minecraft version prefix, if it exists
|
||||
vers["forge"] = strings.TrimPrefix(vers["forge"], m.MCVersion+"-")
|
||||
} else if strings.HasPrefix(m.Modloader.Name, "fabric") {
|
||||
if len(m.Modloader.MavenVersionString) > 0 {
|
||||
vers["fabric"] = strings.TrimPrefix(m.Modloader.MavenVersionString, "net.fabricmc:fabric-loader:")
|
||||
} else {
|
||||
vers["fabric"] = strings.TrimPrefix(m.Modloader.Name, "fabric-")
|
||||
}
|
||||
// Remove the minecraft version suffix, if it exists
|
||||
vers["fabric"] = strings.TrimSuffix(vers["fabric"], m.MCVersion+"-")
|
||||
}
|
||||
return vers
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ type AddonFileReference struct {
|
||||
OptionalDisabled bool
|
||||
}
|
||||
|
||||
func WriteManifestFromPack(pack core.Pack, fileRefs []AddonFileReference, projectID int, jumploaderForgeVersion string, out io.Writer) error {
|
||||
func WriteManifestFromPack(pack core.Pack, fileRefs []AddonFileReference, projectID int, out io.Writer) error {
|
||||
files := make([]struct {
|
||||
ProjectID int `json:"projectID"`
|
||||
FileID int `json:"fileID"`
|
||||
@@ -84,15 +84,14 @@ func WriteManifestFromPack(pack core.Pack, fileRefs []AddonFileReference, projec
|
||||
}
|
||||
|
||||
modLoaders := make([]modLoaderDef, 0, 1)
|
||||
forgeVersion, ok := pack.Versions["forge"]
|
||||
if ok {
|
||||
if fabricVersion, ok := pack.Versions["fabric"]; ok {
|
||||
modLoaders = append(modLoaders, modLoaderDef{
|
||||
ID: "forge-" + forgeVersion,
|
||||
ID: "fabric-" + fabricVersion,
|
||||
Primary: true,
|
||||
})
|
||||
} else if len(jumploaderForgeVersion) > 0 {
|
||||
} else if forgeVersion, ok := pack.Versions["forge"]; ok {
|
||||
modLoaders = append(modLoaders, modLoaderDef{
|
||||
ID: "forge-" + jumploaderForgeVersion,
|
||||
ID: "forge-" + forgeVersion,
|
||||
Primary: true,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user