Provide default when modpack doesn't specify loader (#4930)

* fix no modpack loader, default to minecraft loader

* use v2 create then modify with v3 for environment
This commit is contained in:
Truman Gao
2025-12-18 15:54:00 -08:00
committed by GitHub
parent 8fb38ba0f2
commit 0268600044
2 changed files with 10 additions and 2 deletions

View File

@@ -133,6 +133,8 @@ const addDetectedData = async () => {
if (projectType.value === 'resourcepack') { if (projectType.value === 'resourcepack') {
draftVersion.value.loaders = ['minecraft'] draftVersion.value.loaders = ['minecraft']
} else if (projectType.value === 'modpack' && draftVersion.value.loaders?.length === 0) {
draftVersion.value.loaders = ['minecraft']
} }
} }

View File

@@ -179,9 +179,9 @@ export class LabrinthVersionsV3Module extends AbstractModule {
formData.append(fileParts[i], new Blob([file]), file.name) formData.append(fileParts[i], new Blob([file]), file.name)
}) })
return this.client.request<Labrinth.Versions.v3.Version>(`/version`, { const newVersion = await this.client.request<Labrinth.Versions.v3.Version>(`/version`, {
api: 'labrinth', api: 'labrinth',
version: 3, version: 2,
method: 'POST', method: 'POST',
body: formData, body: formData,
timeout: 120000, timeout: 120000,
@@ -189,6 +189,12 @@ export class LabrinthVersionsV3Module extends AbstractModule {
'Content-Type': '', 'Content-Type': '',
}, },
}) })
await this.modifyVersion(newVersion.id, {
environment: draftVersion.environment,
})
return newVersion
} }
/** /**