You've already forked AstralRinth
forked from didirus/AstralRinth
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:
@@ -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']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user