mirror of
https://github.com/mat-1/azalea.git
synced 2025-08-02 14:26:04 +00:00
generate en_us.json
This commit is contained in:
parent
9a60348292
commit
ab3b99585e
4 changed files with 701 additions and 98 deletions
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,6 @@
|
|||
from typing import Optional
|
||||
from lib.utils import to_snake_case, upper_first_letter, get_dir_location, to_camel_case
|
||||
from ..mappings import Mappings
|
||||
from typing import Optional
|
||||
import re
|
||||
|
||||
REGISTRIES_DIR = get_dir_location('../azalea-registry/src/lib.rs')
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
from lib.download import get_server_jar, get_burger, get_client_jar, get_generator_mod, get_yarn_data, get_fabric_api_versions, get_fabric_loader_versions
|
||||
from lib.utils import get_dir_location
|
||||
from zipfile import ZipFile
|
||||
import subprocess
|
||||
import json
|
||||
import re
|
||||
|
@ -159,3 +160,14 @@ def get_generator_mod_data(version_id: str, category: str):
|
|||
|
||||
with open(f'{target_dir}/{category}.json', 'r') as f:
|
||||
return json.load(f)
|
||||
|
||||
def get_file_from_jar(version_id: str, file_dir: str):
|
||||
get_client_jar(version_id)
|
||||
with ZipFile(get_dir_location(f'downloads/client-{version_id}.jar')) as z:
|
||||
with z.open(file_dir) as f:
|
||||
return f.read()
|
||||
|
||||
def get_en_us_lang(version_id: str):
|
||||
return json.loads(
|
||||
get_file_from_jar(version_id, 'assets/minecraft/lang/en_us.json')
|
||||
)
|
||||
|
|
|
@ -116,6 +116,10 @@ if old_ordered_blocks != new_ordered_blocks:
|
|||
lib.code.blocks.generate_blocks(
|
||||
block_states_burger, block_states_report, old_ordered_blocks, new_mappings)
|
||||
|
||||
print('Getting en_us.json...')
|
||||
language = lib.extract.get_en_us_lang(version_id)
|
||||
lib.code.language.write_language(language)
|
||||
|
||||
|
||||
lib.code.utils.fmt()
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue