diff --git a/foxnap_rpg/assets/__init__.py b/foxnap_rpg/assets/__init__.py index 563fb01..0a29d0f 100644 --- a/foxnap_rpg/assets/__init__.py +++ b/foxnap_rpg/assets/__init__.py @@ -7,7 +7,7 @@ RP_MCMETA: str = r"""{ "pack": { - "pack_format": 31, + "pack_format": 46, "supported_formats": {"min_inclusive": 15, "max_inclusive": 999}, "description": [ { @@ -25,7 +25,7 @@ DP_MCMETA: str = r""" { "pack": { - "pack_format": 45, + "pack_format": 61, "supported_formats": {"min_inclusive": 45, "max_inclusive": 999}, "description": "%%title%%" } diff --git a/foxnap_rpg/pack_generator.py b/foxnap_rpg/pack_generator.py index 9d42698..b86d8ec 100644 --- a/foxnap_rpg/pack_generator.py +++ b/foxnap_rpg/pack_generator.py @@ -227,11 +227,15 @@ def generate_resource_pack( ) models = foxnap_root / "models" / "item" + model_meta = foxnap_root / "items" models.mkdir(parents=True, exist_ok=True) + model_meta.mkdir(parents=True, exist_ok=True) LOGGER.info("Writing record item model jsons") for track in tracks: with (models / f"track_{track.num}.json").open("w") as f: json.dump(generate_model(track.num), f, **json_opts) + with (model_meta / f"track_{track.num}.json").open("w") as f: + json.dump(generate_model_meta(track.num), f, **json_opts) item_textures = foxnap_root / "textures" / "item" item_textures.mkdir(exist_ok=True, parents=True) @@ -385,6 +389,27 @@ def generate_model(track_number: int) -> dict: } +def generate_model_meta(track_number: int) -> dict: + """Generate a model metadata JSON for a new record + + Parameters + ---------- + track_number : int + The number of the track to generate + + Returns + ------- + dict + The model info, all set to be written as JSON + """ + return { + "model": { + "type": "minecraft:model", + "model": f"foxnap:item/track_{track_number}", + } + } + + def create_colored_vinyl( template: Image.Image | None = None, hue_shift: float | None = None ) -> Image.Image: