diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2022-07-29 04:56:21 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-29 04:56:21 +0000 |
| commit | aadf2de3cb751d563e743599a7fb345c08010f5a (patch) | |
| tree | aec2a9485c5057f1c148b87e23ee07a7a6b4978b /codegen/lib/extract.py | |
| parent | 3e43fc6c502573f9d48d801087e72cded37a30b8 (diff) | |
| parent | 2211021105a7ce0ce9fcbc18f3b4f03b0f991a10 (diff) | |
| download | azalea-drasl-aadf2de3cb751d563e743599a7fb345c08010f5a.tar.xz | |
Merge pull request #8 from mat-1/1.19.1
Support 1.19.1. Signing stuff isn't implemented but auth isn't even in Azalea yet so that's fine.
Diffstat (limited to 'codegen/lib/extract.py')
| -rw-r--r-- | codegen/lib/extract.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/codegen/lib/extract.py b/codegen/lib/extract.py index 893b8d5c..4c2d2399 100644 --- a/codegen/lib/extract.py +++ b/codegen/lib/extract.py @@ -1,6 +1,6 @@ # Extracting data from the Minecraft jars -from lib.download import get_server_jar, get_burger, get_client_jar, get_generator_mod, get_yarn_data +from lib.download import get_server_jar, get_burger, get_client_jar, get_generator_mod, get_yarn_data, get_fabric_api_versions from lib.utils import get_dir_location import json import os @@ -61,7 +61,9 @@ def get_generator_mod_data(version_id: str, category: str): # looks like 1.19+build.1 yarn_version = yarn_data['version'] - # the mod has the minecraft version hard-coded by default, so we just change the gradle.properties + fabric_api_version = get_fabric_api_versions()[-1] + + # the mod has the minecraft version hard-coded by default, so we just change the gradle.properties and fabric.mod.json with open(get_dir_location(f'{generator_mod_dir}/gradle.properties'), 'r') as f: lines = f.readlines() with open(get_dir_location(f'{generator_mod_dir}/gradle.properties'), 'w') as f: @@ -70,7 +72,15 @@ def get_generator_mod_data(version_id: str, category: str): line = f'minecraft_version={version_id}\n' if line.startswith('yarn_mappings='): line = f'yarn_mappings={yarn_version}\n' + if line.startswith('fabric_version='): + line = f'fabric_version={fabric_api_version}\n' f.write(line) + # edit the fabric.mod.json to support this version + with open(get_dir_location(f'{generator_mod_dir}/src/main/resources/fabric.mod.json'), 'r') as f: + fabric_mod_json = json.load(f) + fabric_mod_json['depends']['minecraft'] = '*' + with open(get_dir_location(f'{generator_mod_dir}/src/main/resources/fabric.mod.json'), 'w') as f: + json.dump(fabric_mod_json, f, indent=2) os.system( f'cd {generator_mod_dir} && gradlew runServer' |
