From 9d29ca25faa5367affe31319df2d1e2c106ebe2d Mon Sep 17 00:00:00 2001 From: sisby-folk Date: Mon, 8 Jul 2024 14:31:29 +1000 Subject: [PATCH] updates + sidedness fix in-script --- pack/index.toml | 8 ++++---- pack/mods/fabric-api.pw.toml | 8 ++++---- pack/mods/modernfix.pw.toml | 8 ++++---- pack/mods/picturesign.pw.toml | 8 ++++---- pack/mods/surveyor.pw.toml | 8 ++++---- pack/pack.toml | 2 +- scripts/update.py | 22 +++++++++++++++++++--- 7 files changed, 40 insertions(+), 24 deletions(-) diff --git a/pack/index.toml b/pack/index.toml index d16024a..3e12277 100644 --- a/pack/index.toml +++ b/pack/index.toml @@ -587,7 +587,7 @@ metafile = true [[files]] file = "mods/fabric-api.pw.toml" -hash = "e638ef1b06cafcd208d18118d8cc9af49750c26d686fcc97fecce163c5aff56a" +hash = "6cd2d021b71d8172819a6a793ea7a6276822da398c3c74a63b022991414024e5" metafile = true [[files]] @@ -687,7 +687,7 @@ metafile = true [[files]] file = "mods/modernfix.pw.toml" -hash = "cc11c1fb39cdb35ac006ddd77bc33dc578e5ff1314ea76c2b9162ec5b53b10cd" +hash = "5fbbac1c793dc2c4d1068111f6677125c1c8429657d65427da75720ec22942b5" metafile = true [[files]] @@ -722,7 +722,7 @@ metafile = true [[files]] file = "mods/picturesign.pw.toml" -hash = "bb0153edb8f41c61d12e21b72b6fa9d17a4fc7d08cda3e5eed8b940527448a17" +hash = "df28570d634aaf34fee0add2f05290ce975a4f664a82d49e9b30bce810d24580" metafile = true [[files]] @@ -822,7 +822,7 @@ metafile = true [[files]] file = "mods/surveyor.pw.toml" -hash = "b55a34fdf539b5c2ebac7b74b35a3f7a07fbcafd6fc58c625cec4c59fc2b53de" +hash = "3bb5bc1e79455c2d4cb4c400f2cb7fbb331820ca2a7ad31a7b29a7171bb9d186" metafile = true [[files]] diff --git a/pack/mods/fabric-api.pw.toml b/pack/mods/fabric-api.pw.toml index afe8974..30ea914 100644 --- a/pack/mods/fabric-api.pw.toml +++ b/pack/mods/fabric-api.pw.toml @@ -1,13 +1,13 @@ name = "Fabric API" -filename = "fabric-api-0.100.5+1.21.jar" +filename = "fabric-api-0.100.6+1.21.jar" side = "both" [download] -url = "https://cdn.modrinth.com/data/P7dR8mSH/versions/mDmQIaOM/fabric-api-0.100.5%2B1.21.jar" +url = "https://cdn.modrinth.com/data/P7dR8mSH/versions/Y0cpssyN/fabric-api-0.100.6%2B1.21.jar" hash-format = "sha1" -hash = "00e90d988d4432935c3de2f17deacb3edc57390f" +hash = "dd92d95977c960affefc6c29e3ee946ce7b4723a" [update] [update.modrinth] mod-id = "P7dR8mSH" -version = "mDmQIaOM" +version = "Y0cpssyN" diff --git a/pack/mods/modernfix.pw.toml b/pack/mods/modernfix.pw.toml index 44ae1e6..cb09984 100644 --- a/pack/mods/modernfix.pw.toml +++ b/pack/mods/modernfix.pw.toml @@ -1,13 +1,13 @@ name = "ModernFix" -filename = "modernfix-fabric-5.18.5+mc1.21.jar" +filename = "modernfix-fabric-5.18.6+mc1.21.jar" side = "both" [download] -url = "https://cdn.modrinth.com/data/nmDcB62a/versions/Tx3ph266/modernfix-fabric-5.18.5%2Bmc1.21.jar" +url = "https://cdn.modrinth.com/data/nmDcB62a/versions/NUPJxyji/modernfix-fabric-5.18.6%2Bmc1.21.jar" hash-format = "sha1" -hash = "95a0baee24767b7b343d948f1149bec6a56c31e3" +hash = "277669d7a747d5e6e9a0cdb67e5934cb09f818b0" [update] [update.modrinth] mod-id = "nmDcB62a" -version = "Tx3ph266" +version = "NUPJxyji" diff --git a/pack/mods/picturesign.pw.toml b/pack/mods/picturesign.pw.toml index 2194653..c85a64a 100644 --- a/pack/mods/picturesign.pw.toml +++ b/pack/mods/picturesign.pw.toml @@ -1,13 +1,13 @@ name = "PictureSign" -filename = "picturesign-fabric-2.0.0.jar" +filename = "picturesign-fabric-2.0.1.jar" side = "client" [download] -url = "https://cdn.modrinth.com/data/9WP2dmkk/versions/f6MZUNMy/picturesign-fabric-2.0.0.jar" +url = "https://cdn.modrinth.com/data/9WP2dmkk/versions/Fufi3aiS/picturesign-fabric-2.0.1.jar" hash-format = "sha1" -hash = "dac58fe9fdd5a561bfb357c817603e0ddfc5cbd2" +hash = "daab5872b080a2bdeeda218587a78d55745df60c" [update] [update.modrinth] mod-id = "9WP2dmkk" -version = "f6MZUNMy" +version = "Fufi3aiS" diff --git a/pack/mods/surveyor.pw.toml b/pack/mods/surveyor.pw.toml index 5d9830a..184da7f 100644 --- a/pack/mods/surveyor.pw.toml +++ b/pack/mods/surveyor.pw.toml @@ -1,13 +1,13 @@ name = "Surveyor Map Framework" -filename = "surveyor-0.6.7+1.21.jar" +filename = "surveyor-0.6.8+1.21.jar" side = "both" [download] -url = "https://cdn.modrinth.com/data/4KjqhPc9/versions/pLWHAgyZ/surveyor-0.6.7%2B1.21.jar" +url = "https://cdn.modrinth.com/data/4KjqhPc9/versions/yzO0jzIV/surveyor-0.6.8%2B1.21.jar" hash-format = "sha1" -hash = "094f231ff06fddc0068a1e70de07684725cc58e9" +hash = "6885083a92b935895874fbc31f19b6a684d3a4c0" [update] [update.modrinth] mod-id = "4KjqhPc9" -version = "pLWHAgyZ" +version = "yzO0jzIV" diff --git a/pack/pack.toml b/pack/pack.toml index 15830ed..f31fe9b 100644 --- a/pack/pack.toml +++ b/pack/pack.toml @@ -6,7 +6,7 @@ pack-format = "packwiz:1.1.0" [index] file = "index.toml" hash-format = "sha256" -hash = "35c2ab0dc6fd18bf716a29f12a8606e9ab92639c261c7dfc5a49570a0dd86ed3" +hash = "2cce8b12b290a716694711d32ca94b0b57b060a78fb9c2d3b251bb7b7121a423" [versions] fabric = "0.15.11" diff --git a/scripts/update.py b/scripts/update.py index 6e35d45..99c8f06 100644 --- a/scripts/update.py +++ b/scripts/update.py @@ -1,9 +1,22 @@ -import json5 import os import shutil -import requests -import time import subprocess +import time +import re +from pathlib import Path + +import json5 +import requests + + +def find_replace(directory, find, replace, file_pattern): + for file in [f for f in directory.glob(file_pattern)]: + try: + file_contents = file.read_text() + new_file_contents = re.sub(f"{find}", f"{replace}", file_contents) + file.write_text(new_file_contents, newline='\n') + except UnicodeDecodeError: + pass def packwiz_pretty_print(command, ignore_errors=False): @@ -87,6 +100,9 @@ def main(): for mod in overrides_remove: packwiz_pretty_print('packwiz remove ' + mod['project_id'], ignore_errors=True) + # Swap server-side mods to both-sides for singleplayer use + find_replace(Path(mods_path), "side = \"server\"", "side = \"both\"", "*.pw.toml") + # Copy in overriding jar files, you heretic shutil.copytree(overrides_path, './mods', dirs_exist_ok=True) # Python 3.8 :pineapple: