change name of items?
All checks were successful
Release Resource Pack / release (push) Successful in 27s

This commit is contained in:
2025-10-08 21:16:17 +02:00
parent ef8ad43d93
commit 33a2c4c852
135 changed files with 974 additions and 151 deletions

View File

@@ -1,15 +1,22 @@
#!/usr/bin/env python3
"""Update specific music disc description localization keys across all language files.
"""Normalize music disc base names AND description lines plus cookie rename across all locales.
Keys updated:
item.minecraft.music_disc_chirp.desc -> Big F - Fysik
item.minecraft.music_disc_blocks.desc -> Yunge Kutta - Plugga
item.minecraft.music_disc_13.desc -> Yunge Kutta - Nabla Aura
item.minecraft.music_disc_11.desc -> Yunge Kutta - Linjären
item.minecraft.music_disc_cat.desc -> Yunge Kutta - F (Skålar & Pokaler)
We set BOTH the base display name (item.minecraft.music_disc_<id>) and the tooltip/hover line
(.desc) so the in-inventory name and the subtitle line match custom music.
Only modifies files where at least one of the keys exists and value differs.
Preserves key ordering and formatting style (2-space indent) while ensuring a trailing newline.
Target mapping (base + desc get same value):
11 -> Yunge Kutta - Linjären
13 -> Yunge Kutta - Nabla Aura
blocks -> Yunge Kutta - Plugga
cat -> Yunge Kutta - F (Skålar & Pokaler)
chirp -> Big F - Fysik
Additionally rename cookie to Amanuenskaka
Logic:
* For each locale JSON, insert or update the needed keys.
* Preserve other keys untouched.
* Use 2-space indentation, UTF-8, no ASCII escaping.
"""
from __future__ import annotations
@@ -18,12 +25,16 @@ from pathlib import Path
LANG_DIR = Path('assets/minecraft/lang')
MAPPING = {
"item.minecraft.music_disc_chirp.desc": "Big F - Fysik",
"item.minecraft.music_disc_blocks.desc": "Yunge Kutta - Plugga",
"item.minecraft.music_disc_13.desc": "Yunge Kutta - Nabla Aura",
"item.minecraft.music_disc_11.desc": "Yunge Kutta - Linjären",
"item.minecraft.music_disc_cat.desc": "Yunge Kutta - F (Skålar & Pokaler)",
DISC_MAP = {
"11": "Yunge Kutta - Linjären",
"13": "Yunge Kutta - Nabla Aura",
"blocks": "Yunge Kutta - Plugga",
"cat": "Yunge Kutta - F (Skålar & Pokaler)",
"chirp": "Big F - Fysik",
}
EXTRA_KEYS = {
"item.minecraft.cookie": "Amanuenskaka",
}
def main() -> int:
@@ -39,8 +50,19 @@ def main() -> int:
print(f"Skipping {path}: cannot parse JSON ({e})")
continue
updated = False
for key, value in MAPPING.items():
if key in data and data[key] != value:
# Apply disc base + desc keys
for disc_id, value in DISC_MAP.items():
base_key = f"item.minecraft.music_disc_{disc_id}"
desc_key = f"{base_key}.desc"
if data.get(base_key) != value:
data[base_key] = value
updated = True
if data.get(desc_key) != value:
data[desc_key] = value
updated = True
# Apply extra keys
for key, value in EXTRA_KEYS.items():
if data.get(key) != value:
data[key] = value
updated = True
if updated: