diff --git a/.gitignore b/.gitignore index 74c64a3..86d6d71 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -venv\ -.idea\ +venv +.idea *.jar \ No newline at end of file diff --git a/GlowstoneBlock.py b/GlowstoneBlock.py new file mode 100644 index 0000000..5a6fd8f --- /dev/null +++ b/GlowstoneBlock.py @@ -0,0 +1,23 @@ +import zipfile +import json +import os + + +def get_mod_info(target_file): + with zipfile.ZipFile(target_file) as z: + return json.loads(z.read('mcmod.info'))[0] + + +def get_modpack_info(target_dir): + for f in os.scandir(target_dir): + if f.is_file(): + if '.jar' in f.name.lower(): + yield get_mod_info(f.path) + + +def main(): + pass + + +if __name__ == "__main__": + main()