resourcepack: declare compatibility range from 1.21.6 to latest known
Pack.mcmeta now spans pack_format MIN_SUPPORTED_FORMAT (=63, 1.21.6) up to max(LATEST_KNOWN_FORMAT, resolved.format) so a single build loads on every MC from 1.21.6 through 26.1.2+ (currently extending to 86 = 26.2). Both schemas are written: supported_formats for clients on pack_format <= 64, and min_format/max_format for 1.21.9+ clients. pack_format itself stays at the build target so newer clients see the pack as current rather than legacy.
This commit is contained in:
@@ -89,6 +89,7 @@
|
|||||||
"baseShaderOverrideStripped": "베이스 리소스팩의 vanilla 셰이더 오버라이드 제거: assets/minecraft/shaders/{{path}} — mcVersion {{mc}} (pack_format {{format}}) 의 새 GLSL API 와 호환되지 않아 결과 zip 에서 제외했습니다.",
|
"baseShaderOverrideStripped": "베이스 리소스팩의 vanilla 셰이더 오버라이드 제거: assets/minecraft/shaders/{{path}} — mcVersion {{mc}} (pack_format {{format}}) 의 새 GLSL API 와 호환되지 않아 결과 zip 에서 제외했습니다.",
|
||||||
"packFormatMatched": "pack_format = {{format}} (mcVersion {{matched}})",
|
"packFormatMatched": "pack_format = {{format}} (mcVersion {{matched}})",
|
||||||
"packFormatFallback": "pack_format = {{format}} (mcVersion \"{{version}}\" 매칭 실패, 최신 폴백)",
|
"packFormatFallback": "pack_format = {{format}} (mcVersion \"{{version}}\" 매칭 실패, 최신 폴백)",
|
||||||
|
"packFormatRange": "호환 범위 선언: pack_format {{min}} ~ {{max}} (supported_formats / min_format / max_format 모두 기록)",
|
||||||
"soundsMerged": "기존 sounds.json 병합 ({{count}}개 항목)",
|
"soundsMerged": "기존 sounds.json 병합 ({{count}}개 항목)",
|
||||||
"ytdlpLine": "yt-dlp> {{line}}"
|
"ytdlpLine": "yt-dlp> {{line}}"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { promises as fs, createWriteStream } from 'node:fs'
|
|||||||
import path from 'node:path'
|
import path from 'node:path'
|
||||||
import archiver from 'archiver'
|
import archiver from 'archiver'
|
||||||
import extract from 'extract-zip'
|
import extract from 'extract-zip'
|
||||||
import { resolveResourcePackFormat } from './packFormat.js'
|
import { resolveResourcePackFormat, MIN_SUPPORTED_FORMAT, LATEST_KNOWN_FORMAT } from './packFormat.js'
|
||||||
import { loadComponentI18n } from '../shared/i18n.js'
|
import { loadComponentI18n } from '../shared/i18n.js'
|
||||||
|
|
||||||
const { t } = loadComponentI18n('installer-rp')
|
const { t } = loadComponentI18n('installer-rp')
|
||||||
@@ -88,20 +88,22 @@ export async function buildResourcepackZip(opts: BuildResourcepackOptions): Prom
|
|||||||
// 없으면 정상. 무시.
|
// 없으면 정상. 무시.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// pack_format > 64 (즉 1.21.9+) 부터는 supported_formats 가 폐기되고
|
// 호환 범위는 1.21.6 (=MIN_SUPPORTED_FORMAT) 부터 알려진 최신까지 선언한다.
|
||||||
// min_format / max_format 가 필수다. 그 이하는 종전대로 supported_formats 사용.
|
// 빌드 타깃이 LATEST_KNOWN_FORMAT 보다 높으면(테이블 갱신 전 신버전) 그 값까지 확장.
|
||||||
|
const minFmt = Math.min(MIN_SUPPORTED_FORMAT, resolved.format)
|
||||||
|
const maxFmt = Math.max(LATEST_KNOWN_FORMAT, resolved.format)
|
||||||
|
// pack_format <= 64 인 MC 는 supported_formats 를, > 64 인 MC 는 min_format/max_format 을
|
||||||
|
// 읽는다. 어느 한쪽만 두면 반대편 클라이언트에서 거부되므로 양쪽 모두 기록한다.
|
||||||
const packMeta: Record<string, unknown> = {
|
const packMeta: Record<string, unknown> = {
|
||||||
description: t('pack.description', { name: opts.packName }),
|
description: t('pack.description', { name: opts.packName }),
|
||||||
pack_format: resolved.format
|
pack_format: resolved.format,
|
||||||
}
|
supported_formats: { min_inclusive: minFmt, max_inclusive: maxFmt },
|
||||||
if (resolved.format > 64) {
|
min_format: minFmt,
|
||||||
packMeta.min_format = resolved.format
|
max_format: maxFmt
|
||||||
packMeta.max_format = resolved.format
|
|
||||||
} else {
|
|
||||||
packMeta.supported_formats = { min_inclusive: resolved.format, max_inclusive: resolved.format }
|
|
||||||
}
|
}
|
||||||
const mcmeta = { pack: packMeta }
|
const mcmeta = { pack: packMeta }
|
||||||
await fs.writeFile(path.join(root, 'pack.mcmeta'), JSON.stringify(mcmeta, null, 2) + '\n')
|
await fs.writeFile(path.join(root, 'pack.mcmeta'), JSON.stringify(mcmeta, null, 2) + '\n')
|
||||||
|
opts.log?.(t('log.packFormatRange', { min: minFmt, max: maxFmt }))
|
||||||
|
|
||||||
// 2) 음악 파일 복사 + sounds.json 생성/병합
|
// 2) 음악 파일 복사 + sounds.json 생성/병합
|
||||||
const musicFiles = (await fs.readdir(opts.musicDir))
|
const musicFiles = (await fs.readdir(opts.musicDir))
|
||||||
|
|||||||
@@ -24,6 +24,12 @@ const TABLE: Array<readonly [string, number]> = [
|
|||||||
/** 테이블에서 마지막(=최신) 항목의 포맷. 알 수 없는 mcVersion 에 대한 폴백. */
|
/** 테이블에서 마지막(=최신) 항목의 포맷. 알 수 없는 mcVersion 에 대한 폴백. */
|
||||||
export const LATEST_KNOWN_FORMAT: number = TABLE[TABLE.length - 1][1]
|
export const LATEST_KNOWN_FORMAT: number = TABLE[TABLE.length - 1][1]
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 리소스팩이 호환된다고 선언할 최소 pack_format.
|
||||||
|
* 1.21.6 (=63) 부터를 지원 범위 하한으로 둔다.
|
||||||
|
*/
|
||||||
|
export const MIN_SUPPORTED_FORMAT = 63
|
||||||
|
|
||||||
export interface ResolvedFormat {
|
export interface ResolvedFormat {
|
||||||
/** 매칭된 mcVersion 키 (없으면 null). */
|
/** 매칭된 mcVersion 키 (없으면 null). */
|
||||||
matched: string | null
|
matched: string | null
|
||||||
|
|||||||
Reference in New Issue
Block a user