Fix generated language resource duplication
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"itemGroup.crusty_chunks.warium": "Warium"
|
||||
}
|
||||
@@ -25,6 +25,7 @@ def main() -> None:
|
||||
standalone_items = sorted(name for name in item_model_names if name not in set(block_names))
|
||||
|
||||
extract_resources(archive)
|
||||
merge_language_defaults()
|
||||
|
||||
inventory = {
|
||||
"source": "Warium 1.2.7",
|
||||
@@ -137,5 +138,15 @@ def write_generated_registries(blocks: list[str], items: list[str]) -> None:
|
||||
(package_dir / "GeneratedRegistries.java").write_text("\n".join(lines), encoding="utf-8")
|
||||
|
||||
|
||||
def merge_language_defaults() -> None:
|
||||
lang_path = GENERATED_RESOURCES / "assets" / MODID / "lang" / "en_us.json"
|
||||
if lang_path.exists():
|
||||
data = json.loads(lang_path.read_text(encoding="utf-8"))
|
||||
else:
|
||||
data = {}
|
||||
data.setdefault("itemGroup.crusty_chunks.warium", "Warium")
|
||||
write_json(lang_path, data)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user