resourcepack: warn when base zip overrides vanilla shaders

The actual "리소스 새로고침 실패" was caused by pack.mcmeta JsonParseException
(fixed in 6718315). The shader compile errors seen on the same log come from
the user-supplied base resourcepack overriding vanilla shaders for an older
MC. Auto-stripping would silently destroy the user's intended look, so emit
a clear warning during build instead and let the user decide whether to
update the base pack.
This commit is contained in:
2026-05-14 21:28:41 +09:00
parent 671831535b
commit 9cb7c05b43
2 changed files with 15 additions and 0 deletions

View File

@@ -86,6 +86,7 @@
"ffmpegExtracting": "ffmpeg zip 압축 해제 중…",
"ffmpegReady": "ffmpeg.exe 준비 완료: {{path}}",
"baseExtract": "베이스 리소스팩 압축 해제: {{name}}",
"baseShaderOverrideWarn": "경고: 베이스 리소스팩에 vanilla 셰이더 오버라이드(assets/minecraft/shaders/{{path}}) 가 포함됨. mcVersion {{mc}} 와 호환되지 않으면 셰이더 컴파일이 실패할 수 있습니다.",
"packFormatMatched": "pack_format = {{format}} (mcVersion {{matched}})",
"packFormatFallback": "pack_format = {{format}} (mcVersion \"{{version}}\" 매칭 실패, 최신 폴백)",
"soundsMerged": "기존 sounds.json 병합 ({{count}}개 항목)",

View File

@@ -50,6 +50,20 @@ export async function buildResourcepackZip(opts: BuildResourcepackOptions): Prom
if (opts.baseZipPath) {
opts.log?.(t('log.baseExtract', { name: path.basename(opts.baseZipPath) }))
await extract(opts.baseZipPath, { dir: root })
// vanilla 셰이더 오버라이드(assets/minecraft/shaders/) 가 있으면 경고만 띄운다.
// 자동 제거는 사용자의 의도된 룩을 해칠 수 있어 하지 않는다.
const vanillaShaderDir = path.join(root, 'assets', 'minecraft', 'shaders')
try {
const stat = await fs.stat(vanillaShaderDir)
if (stat.isDirectory()) {
const entries = await fs.readdir(vanillaShaderDir)
if (entries.length > 0) {
opts.log?.(t('log.baseShaderOverrideWarn', { path: entries.join(', '), mc: opts.mcVersion }))
}
}
} catch {
// 없으면 정상. 무시.
}
}
const soundsDir = path.join(root, 'assets', NAMESPACE, 'sounds')