Files
Warium-NeoForge-1.21.1/tools/registry_parity.py
Codex 6ef5fdd378
Some checks failed
Build / build (push) Failing after 13m38s
Release Dry Run / release-dry-run (push) Successful in 5s
Codex Template Compliance / template-compliance (push) Successful in 5s
Bootstrap Warium NeoForge port scaffold
2026-05-09 20:59:05 +02:00

32 lines
1.3 KiB
Python

from __future__ import annotations
import json
from pathlib import Path
from warium_source import ROOT
def main() -> None:
inventory_path = ROOT / "docs" / "inventory" / "original-inventory.json"
generated_source = ROOT / "src" / "generated" / "java" / "net" / "mcreator" / "crustychunks" / "init" / "GeneratedRegistries.java"
if not inventory_path.exists() or not generated_source.exists():
raise SystemExit("Generated inventory is missing; run generatePortSources first.")
inventory = json.loads(inventory_path.read_text(encoding="utf-8"))
source = generated_source.read_text(encoding="utf-8")
missing_blocks = [name for name in inventory["blocks_from_blockstates"] if f'"{name}"' not in source]
missing_items = [name for name in inventory["standalone_items_from_item_models"] if f'"{name}"' not in source]
if missing_blocks or missing_items:
raise SystemExit(
"Registry parity failed: "
f"{len(missing_blocks)} blocks missing, {len(missing_items)} standalone items missing"
)
print(
"Registry parity OK: "
f"{len(inventory['blocks_from_blockstates'])} blocks and "
f"{len(inventory['standalone_items_from_item_models'])} standalone items generated."
)
if __name__ == "__main__":
main()