Eradicate variable-size integer types where not used by interface or as index (fixes #107)

This commit is contained in:
comp500
2022-06-16 21:32:15 +01:00
parent d051932bbb
commit d5290ebd32
12 changed files with 125 additions and 112 deletions

View File

@@ -8,15 +8,15 @@ type cursePackMeta struct {
ModLoaders []modLoaderDef `json:"modLoaders"`
} `json:"minecraft"`
ManifestType string `json:"manifestType"`
ManifestVersion int `json:"manifestVersion"`
ManifestVersion uint32 `json:"manifestVersion"`
NameInternal string `json:"name"`
Version string `json:"version"`
Author string `json:"author"`
ProjectID int `json:"projectID"`
ProjectID uint32 `json:"projectID"`
Files []struct {
ProjectID int `json:"projectID"`
FileID int `json:"fileID"`
Required bool `json:"required"`
ProjectID uint32 `json:"projectID"`
FileID uint32 `json:"fileID"`
Required bool `json:"required"`
} `json:"files"`
Overrides string `json:"overrides"`
importSrc ImportPackSource

View File

@@ -17,10 +17,10 @@ type twitchInstalledPackMeta struct {
} `json:"baseModLoader"`
ModpackOverrides []string `json:"modpackOverrides"`
ModsInternal []struct {
ID int `json:"addonID"`
ID uint32 `json:"addonID"`
File struct {
// I've given up on using this cached data, just going to re-request it
ID int `json:"id"`
ID uint32 `json:"id"`
// Used to determine if the mod is optional-disabled
FileNameOnDisk string
} `json:"installedFile"`

View File

@@ -63,23 +63,23 @@ func ReadMetadata(s ImportPackSource) ImportPackMetadata {
// AddonFileReference is a struct to reference a single file on CurseForge
type AddonFileReference struct {
ProjectID int
FileID int
ProjectID uint32
FileID uint32
// OptionalDisabled is true if the file is optional and disabled (turned off in Twitch launcher)
OptionalDisabled bool
}
func WriteManifestFromPack(pack core.Pack, fileRefs []AddonFileReference, projectID int, out io.Writer) error {
func WriteManifestFromPack(pack core.Pack, fileRefs []AddonFileReference, projectID uint32, out io.Writer) error {
files := make([]struct {
ProjectID int `json:"projectID"`
FileID int `json:"fileID"`
Required bool `json:"required"`
ProjectID uint32 `json:"projectID"`
FileID uint32 `json:"fileID"`
Required bool `json:"required"`
}, len(fileRefs))
for i, fr := range fileRefs {
files[i] = struct {
ProjectID int `json:"projectID"`
FileID int `json:"fileID"`
Required bool `json:"required"`
ProjectID uint32 `json:"projectID"`
FileID uint32 `json:"fileID"`
Required bool `json:"required"`
}{ProjectID: fr.ProjectID, FileID: fr.FileID, Required: !fr.OptionalDisabled}
}