From 422c319f1fae572ed12f02bd4afe223775bef455 Mon Sep 17 00:00:00 2001 From: hkc Date: Wed, 22 May 2024 13:12:20 +0300 Subject: [PATCH] Filename is now dependent on the texture --- .gitignore | 2 +- make.py | 32 +++++++++++++++++++++++--------- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index cf00ce3..0e11532 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ __pycache__/ venv/ input/ output/ -pack.zip +*.zip diff --git a/make.py b/make.py index a584012..ac2d5f9 100644 --- a/make.py +++ b/make.py @@ -194,26 +194,40 @@ async def main(seam_texture: str = "block.dark_oak_planks"): fp.write(f"matchBlocks=seasonsextras:{texture_name}\n") fp.write(f"tiles=0-46\n") fp.write(f"connect=block\n") - fp.write(f"resourceCondition=seasonsextras:textures/block/{texture_name}.png\n") + fp.write( + f"resourceCondition=seasonsextras:textures/block/{texture_name}.png\n" + ) with Image.open(GLASS_CACHE_SEAMLESS / f"{color}.png") as glass: for i in range(47): ctm = Image.composite(border_texture, glass, ctm_list[i]) ctm.save(out_path / f"{i}.png") if i == 0: - ctm.save(OUTPUT_PATH / "assets/seasonsextras/textures/block/{texture_name}.png") + ctm.save( + OUTPUT_PATH + / "assets/seasonsextras/textures/block/{texture_name}.png" + ) with (OUTPUT_PATH / "pack.mcmeta").open("w") as fp: - json.dump({ - "pack": { - "pack_format": 15, - "description": f"CTM support for Fabric Seasons Extras. {seam_texture}" - } - }, fp, indent=2, ensure_ascii=False) + json.dump( + { + "pack": { + "pack_format": 15, + "description": f"CTM support for Fabric Seasons Extras. {seam_texture}", + } + }, + fp, + indent=2, + ensure_ascii=False, + ) - with ZipFile("pack.zip", "w") as zipf: + with ZipFile( + f"seasons-ctm-{seam_texture.split('.', 1)[-1]}.zip", "w" + ) as zipf: zipf.write(GLASS_OUTPUT_PATH / "purple" / "0.png", "pack.png") for file in OUTPUT_PATH.rglob("*"): zipf.write(file, Path(*file.parts[1:])) + if __name__ == "__main__": from sys import argv + asyncio.run(main(*argv[1:]))