fix(resourcepack): emit min_format/max_format when pack_format > 64
MC 1.21.9+ (pack_format >= 65) deprecated supported_formats and now requires min_format/max_format at pack root. On 26.1.x (format 84) the old supported_formats made pack.mcmeta unparseable, so MC rejected the music-quiz resourcepack with "리소스 새로고침 실패" on reload.
This commit is contained in:
@@ -64,13 +64,19 @@ export async function buildResourcepackZip(opts: BuildResourcepackOptions): Prom
|
||||
} else {
|
||||
opts.log?.(t('log.packFormatFallback', { format: resolved.format, version: opts.mcVersion }))
|
||||
}
|
||||
const mcmeta = {
|
||||
pack: {
|
||||
// pack_format > 64 (즉 1.21.9+) 부터는 supported_formats 가 폐기되고
|
||||
// min_format / max_format 가 필수다. 그 이하는 종전대로 supported_formats 사용.
|
||||
const packMeta: Record<string, unknown> = {
|
||||
description: t('pack.description', { name: opts.packName }),
|
||||
pack_format: resolved.format,
|
||||
supported_formats: { min_inclusive: resolved.format, max_inclusive: resolved.format }
|
||||
pack_format: resolved.format
|
||||
}
|
||||
if (resolved.format > 64) {
|
||||
packMeta.min_format = resolved.format
|
||||
packMeta.max_format = resolved.format
|
||||
} else {
|
||||
packMeta.supported_formats = { min_inclusive: resolved.format, max_inclusive: resolved.format }
|
||||
}
|
||||
const mcmeta = { pack: packMeta }
|
||||
await fs.writeFile(path.join(root, 'pack.mcmeta'), JSON.stringify(mcmeta, null, 2) + '\n')
|
||||
|
||||
// 2) 음악 파일 복사 + sounds.json 생성/병합
|
||||
|
||||
Reference in New Issue
Block a user