Fix #319 keep unknown files when importing and downloading a project

This commit is contained in:
Misode
2024-10-04 15:30:35 +02:00
parent 394beeab16
commit 5d08f15006
5 changed files with 23 additions and 9 deletions

View File

@@ -77,6 +77,9 @@ export function ProjectPanel({ onRename, onCreate, onDeleteProject }: Props) {
if (path === 'pack.mcmeta') hasPack = true
return [[path, stringifySource(file.data)]] as [string, string][]
})
project.unknownFiles?.forEach(({ path, data }) => {
entries.push([path, data])
})
if (!hasPack) {
const pack_format = config.versions.find(v => v.id === version)!.pack_format
entries.push(['pack.mcmeta', stringifySource({ pack: { pack_format, description: '' } })])