Skip to content

Commit 945bece

Browse files
committed
.build.json Change
Added config to specify mod loader Changed forgeVersion to modLoaderVersion
1 parent ee75ae2 commit 945bece

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

exporter.go

+15-1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,19 @@ func main() {
4646
}
4747

4848
BuildConfig = readBuildJson(*buildConfig)
49+
if BuildConfig.PackAuthor == "" {
50+
fmt.Println("Invalid .build.json, Author not specified")
51+
os.Exit(1)
52+
} else if BuildConfig.MinecraftVersion == "" {
53+
fmt.Println("Invalid .build.json, Minecraft Version not specified")
54+
os.Exit(1)
55+
} else if BuildConfig.ModLoader == "" {
56+
fmt.Println("Invalid .build.json, Mod Loader not specified")
57+
os.Exit(1)
58+
} else if BuildConfig.ModLoaderVersion == "" {
59+
fmt.Println("Invalid .build.json, Mod Loader Version not specified")
60+
os.Exit(1)
61+
}
4962
PackDIR = *mcDirCLI
5063
readMCDIR(*mcDirCLI)
5164
}
@@ -147,7 +160,8 @@ func createExport(projectFiles []fingerprintExactMatches) {
147160
for _, file := range projectFiles {
148161
tempFiles = append(tempFiles, manifestFiles{file.Id, file.File.Id, true})
149162
}
150-
modloader = append(modloader, manifestMinecraftModLoaders{"forge-" + BuildConfig.ForgeVersion, true})
163+
//modloader = append(modloader, manifestMinecraftModLoaders{"forge-" + BuildConfig.ForgeVersion, true})
164+
modloader = append(modloader, manifestMinecraftModLoaders{BuildConfig.ModLoader + "-" + BuildConfig.ModLoaderVersion, true})
151165
manifestMc := manifestMinecraft{BuildConfig.MinecraftVersion, modloader}
152166
manifestB := manifestBase{manifestMc, "minecraftModpack", 1, *ExportName, *PackVersion, BuildConfig.PackAuthor, tempFiles, "overrides"}
153167
// test below

structs.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ package main
33
type buildJson struct {
44
PackAuthor string `json:"packAuthor"`
55
MinecraftVersion string `json:"minecraftVersion"`
6-
ForgeVersion string `json:"forgeVersion"`
7-
ModsFolder string `json:"modsFolder"`
6+
ModLoader string `json:"modLoader"`
7+
ModLoaderVersion string `json:"modLoaderVersion"`
8+
//ModsFolder string `json:"modsFolder"`
89
Includes []string `json:"includes"`
910
}
1011

@@ -77,4 +78,4 @@ type fingerprintFile struct {
7778
type fileModules struct {
7879
FolderName string `json:"folderName"`
7980
Fingerprint int `json:"fimgerprint"`
80-
}
81+
}

0 commit comments

Comments
 (0)