From 04aea6afaf6819a66181d5d544356764d118b1bb Mon Sep 17 00:00:00 2001 From: mat Date: Tue, 24 May 2022 19:50:19 -0500 Subject: [PATCH 01/27] code-generator/lib --- .gitignore | 7 -- code-generator/.gitignore | 3 + code-generator/{ => lib}/mappings.py | 0 code-generator/{ => lib}/packetcodegen.py | 0 code-generator/{ => lib}/utils.py | 0 code-generator/lib/version.py | 80 +++++++++++++++++++++++ code-generator/main.py | 49 +------------- 7 files changed, 86 insertions(+), 53 deletions(-) create mode 100644 code-generator/.gitignore rename code-generator/{ => lib}/mappings.py (100%) rename code-generator/{ => lib}/packetcodegen.py (100%) rename code-generator/{ => lib}/utils.py (100%) create mode 100644 code-generator/lib/version.py diff --git a/.gitignore b/.gitignore index 53141060..ad9bfc78 100644 --- a/.gitignore +++ b/.gitignore @@ -3,10 +3,3 @@ flamegraph.svg perf.data perf.data.old - - -code-generator/Burger -code-generator/client.jar -code-generator/burger.json -__pycache__ -*.tmp diff --git a/code-generator/.gitignore b/code-generator/.gitignore new file mode 100644 index 00000000..2ef6e1be --- /dev/null +++ b/code-generator/.gitignore @@ -0,0 +1,3 @@ +downloads +__pycache__ +*.tmp diff --git a/code-generator/mappings.py b/code-generator/lib/mappings.py similarity index 100% rename from code-generator/mappings.py rename to code-generator/lib/mappings.py diff --git a/code-generator/packetcodegen.py b/code-generator/lib/packetcodegen.py similarity index 100% rename from code-generator/packetcodegen.py rename to code-generator/lib/packetcodegen.py diff --git a/code-generator/utils.py b/code-generator/lib/utils.py similarity index 100% rename from code-generator/utils.py rename to code-generator/lib/utils.py diff --git a/code-generator/lib/version.py b/code-generator/lib/version.py new file mode 100644 index 00000000..f50ab461 --- /dev/null +++ b/code-generator/lib/version.py @@ -0,0 +1,80 @@ +from mappings import Mappings +import requests +import json +import os + + +def download_burger(): + print('\033[92mDownloading Burger...\033[m') + os.system( + 'cd downloads && git clone https://github.com/pokechu22/Burger && cd Burger && git pull') + + print('\033[92mInstalling dependencies...\033[m') + os.system('cd downloads/Burger && pip install six jawa') + + +def get_version_manifest(): + if not os.path.exists(f'downloads/version_manifest.json'): + print( + f'\033[92mDownloading version manifest...\033[m') + version_manifest_data = requests.get( + 'https://launchermeta.mojang.com/mc/game/version_manifest.json').json() + with open(f'downloads/version_manifest.json', 'w') as f: + json.dump(version_manifest_data, f) + else: + with open(f'downloads/version_manifest.json', 'r') as f: + version_manifest_data = json.load(f) + return version_manifest_data + + +def get_version_data(version_id: str): + if not os.path.exists(f'downloads/{version_id}.json'): + version_manifest_data = get_version_manifest() + + print( + f'\033[92mGetting data for \033[1m{version_id}..\033[m') + package_url = next( + filter(lambda v: v['id'] == version_id, version_manifest_data['versions']))['url'] + package_data = requests.get(package_url).json() + with open(f'downloads/{version_id}.json', 'w') as f: + json.dump(package_data, f) + else: + with open(f'downloads/{version_id}.json', 'r') as f: + package_data = json.load(f) + return package_data + + +def get_client_jar(version_id: str): + if not os.path.exists(f'downloads/client-{version_id}.jar'): + package_data = get_version_data(version_id) + print('\033[92mDownloading client jar...\033[m') + client_jar_url = package_data['downloads']['client']['url'] + with open('client.jar', 'wb') as f: + f.write(requests.get(client_jar_url).content) + + +def get_burger_data_for_version(version_id: str): + if not os.path.exists(f'downloads/burger-{version_id}.json'): + get_client_jar(version_id) + + os.system( + f'cd downloads/Burger && python munch.py ../client-{version_id}.jar --output ../burger-{version_id}.json' + ) + with open(f'burger-{version_id}.json', 'r') as f: + return json.load(f) + + +def get_mappings_for_version(version_id: str): + if not os.path.exists(f'downloads/mappings-{version_id}.json'): + package_data = get_version_data(version_id) + + client_mappings_url = package_data['downloads']['client_mappings']['url'] + + mappings_text = requests.get(client_mappings_url).text + + with open(f'downloads/mappings-{version_id}.json', 'w') as f: + f.write(mappings_text) + else: + with open(f'downloads/mappings-{version_id}.json', 'r') as f: + mappings_text = f.read() + return Mappings.parse(mappings_text) diff --git a/code-generator/main.py b/code-generator/main.py index 78d307b7..54ad3946 100644 --- a/code-generator/main.py +++ b/code-generator/main.py @@ -1,54 +1,11 @@ -from mappings import Mappings -import packetcodegen +from .lib import version, packetcodegen import requests import json import sys import os -print( - f'\033[92mFinding Minecraft version...\033[m') -version_manifest_data = requests.get( - 'https://launchermeta.mojang.com/mc/game/version_manifest.json').json() -minecraft_version = version_manifest_data['latest']['release'] -print( - f'\033[92mUsing \033[1m{minecraft_version}..\033[m') -package_url = next( - filter(lambda v: v['id'] == minecraft_version, version_manifest_data['versions']))['url'] -package_data = requests.get(package_url).json() -client_jar_url = package_data['downloads']['client']['url'] - -skipping_burger = False -try: - with open('burger.json', 'r') as f: - burger_data = json.load(f)[0] - if burger_data['version']['id'] == minecraft_version: - skipping_burger = True - print( - f'\033[92mSkipping Burger step because the burger.json is up-to-date.\033[m') -except FileNotFoundError: - pass - -if not skipping_burger: - print('\033[92mDownloading Burger...\033[m') - r = os.system('git clone https://github.com/pokechu22/Burger') - os.system('cd Burger && git pull') - - # print('\033[92mInstalling dependencies...\033[m') - # os.system('cd Burger && pip install six jawa') - - print('\033[92mDownloading client jar...\033[m') - with open('client.jar', 'wb') as f: - f.write(requests.get(client_jar_url).content) - - print(f'\033[92mExtracting data with Burger...\033[m') - os.system( - 'cd Burger && python munch.py ../client.jar --output ../burger.json') - -client_mappings_url = package_data['downloads']['client_mappings']['url'] -mappings = Mappings.parse(requests.get(client_mappings_url).text) - -with open('burger.json', 'r') as f: - burger_data = json.load(f) +mappings = version.get_mappings_for_version('1.18.2') +burger_data = version.get_burger_data_for_version('1.18.2') burger_packets_data = burger_data[0]['packets']['packet'] packet_id, direction, state = int(sys.argv[1]), sys.argv[2], sys.argv[3] From 0a314bca16f6de199c319ffb0d84a5d5c3a61387 Mon Sep 17 00:00:00 2001 From: mat Date: Tue, 24 May 2022 20:28:08 -0500 Subject: [PATCH 02/27] rename code-generator to codegen --- README.md | 3 ++ code-generator/README.md | 8 ----- {code-generator => codegen}/.gitignore | 0 codegen/README.md | 13 ++++++++ codegen/burger.json | 1 + .../lib/version.py => codegen/lib/download.py | 33 ++++++++++++------- {code-generator => codegen}/lib/mappings.py | 0 .../lib/packetcodegen.py | 5 ++- {code-generator => codegen}/lib/utils.py | 0 .../main.py => codegen/newpacket.py | 8 ++--- 10 files changed, 43 insertions(+), 28 deletions(-) delete mode 100644 code-generator/README.md rename {code-generator => codegen}/.gitignore (100%) create mode 100644 codegen/README.md create mode 100644 codegen/burger.json rename code-generator/lib/version.py => codegen/lib/download.py (69%) rename {code-generator => codegen}/lib/mappings.py (100%) rename {code-generator => codegen}/lib/packetcodegen.py (98%) rename {code-generator => codegen}/lib/utils.py (100%) rename code-generator/main.py => codegen/newpacket.py (69%) diff --git a/README.md b/README.md index c9942141..d3ebdf51 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,9 @@ A Rust crate for creating Minecraft bots. Azalea

+ +*Currently supported Minecraft version: `1.18.2`.* + I named this Azalea because it sounds like a cool word and this is a cool library. This project was heavily inspired by PrismarineJS. ## Why diff --git a/code-generator/README.md b/code-generator/README.md deleted file mode 100644 index a6c60c47..00000000 --- a/code-generator/README.md +++ /dev/null @@ -1,8 +0,0 @@ -Tools for automatically generating code to help with updating Minecraft versions. - -The directory name doesn't start with `azalea-` because it's not a Rust crate. - -## Usage - -Generate packet:\ -`python main.py [packet id] [clientbound or serverbound] \[game/handshake/login/status\]` diff --git a/code-generator/.gitignore b/codegen/.gitignore similarity index 100% rename from code-generator/.gitignore rename to codegen/.gitignore diff --git a/codegen/README.md b/codegen/README.md new file mode 100644 index 00000000..fa00b63f --- /dev/null +++ b/codegen/README.md @@ -0,0 +1,13 @@ +Tools for automatically generating code to help with updating Minecraft versions. + +The directory name doesn't start with `azalea-` because it's not a Rust crate. + +## Usage + +Generate packet:\ +`python newpacket.py [packet id] [clientbound or serverbound] \[game/handshake/login/status\]`\ +This will create a new file in the `azalea-protocol/src/packets/\[state\] directory`. You will probably have to manually fix up the auto generated code. + +Migrate to a new Minecraft version:\ +`python migrate.py [new version]`\ +This updates all the packet ids in `azalea-protocol/src/packets/mod.rs` and creates all the new packets. diff --git a/codegen/burger.json b/codegen/burger.json new file mode 100644 index 00000000..4fa39aa3 --- /dev/null +++ b/codegen/burger.json @@ -0,0 +1 @@ +{"message": "Not Found", "documentation_url": "https://docs.github.com/rest/reference/repos#get-the-latest-release"} \ No newline at end of file diff --git a/code-generator/lib/version.py b/codegen/lib/download.py similarity index 69% rename from code-generator/lib/version.py rename to codegen/lib/download.py index f50ab461..284591ab 100644 --- a/code-generator/lib/version.py +++ b/codegen/lib/download.py @@ -1,16 +1,24 @@ -from mappings import Mappings +from .mappings import Mappings import requests import json import os +# make sure the downloads directory exists +if not os.path.exists('downloads'): + os.mkdir('downloads') -def download_burger(): - print('\033[92mDownloading Burger...\033[m') - os.system( - 'cd downloads && git clone https://github.com/pokechu22/Burger && cd Burger && git pull') - print('\033[92mInstalling dependencies...\033[m') - os.system('cd downloads/Burger && pip install six jawa') +def get_burger(): + if not os.path.exists('downloads/Burger'): + with open('burger.json', 'w') as f: + json.dump(requests.get( + 'https://api.github.com/repos/Burger/Burger/releases/latest').json(), f) + print('\033[92mDownloading Burger...\033[m') + os.system( + 'cd downloads && git clone https://github.com/pokechu22/Burger && cd Burger && git pull') + + print('\033[92mInstalling dependencies...\033[m') + os.system('cd downloads/Burger && pip install six jawa') def get_version_manifest(): @@ -49,32 +57,33 @@ def get_client_jar(version_id: str): package_data = get_version_data(version_id) print('\033[92mDownloading client jar...\033[m') client_jar_url = package_data['downloads']['client']['url'] - with open('client.jar', 'wb') as f: + with open(f'downloads/client-{version_id}.jar', 'wb') as f: f.write(requests.get(client_jar_url).content) def get_burger_data_for_version(version_id: str): if not os.path.exists(f'downloads/burger-{version_id}.json'): + get_burger() get_client_jar(version_id) os.system( f'cd downloads/Burger && python munch.py ../client-{version_id}.jar --output ../burger-{version_id}.json' ) - with open(f'burger-{version_id}.json', 'r') as f: + with open(f'downloads/burger-{version_id}.json', 'r') as f: return json.load(f) def get_mappings_for_version(version_id: str): - if not os.path.exists(f'downloads/mappings-{version_id}.json'): + if not os.path.exists(f'downloads/mappings-{version_id}.txt'): package_data = get_version_data(version_id) client_mappings_url = package_data['downloads']['client_mappings']['url'] mappings_text = requests.get(client_mappings_url).text - with open(f'downloads/mappings-{version_id}.json', 'w') as f: + with open(f'downloads/mappings-{version_id}.txt', 'w') as f: f.write(mappings_text) else: - with open(f'downloads/mappings-{version_id}.json', 'r') as f: + with open(f'downloads/mappings-{version_id}.txt', 'r') as f: mappings_text = f.read() return Mappings.parse(mappings_text) diff --git a/code-generator/lib/mappings.py b/codegen/lib/mappings.py similarity index 100% rename from code-generator/lib/mappings.py rename to codegen/lib/mappings.py diff --git a/code-generator/lib/packetcodegen.py b/codegen/lib/packetcodegen.py similarity index 98% rename from code-generator/lib/packetcodegen.py rename to codegen/lib/packetcodegen.py index 3d453a4e..b4c6a83b 100644 --- a/code-generator/lib/packetcodegen.py +++ b/codegen/lib/packetcodegen.py @@ -1,6 +1,5 @@ -from utils import to_snake_case, to_camel_case -from mappings import Mappings -import os +from .utils import to_snake_case, to_camel_case +from .mappings import Mappings def burger_type_to_rust_type(burger_type): diff --git a/code-generator/lib/utils.py b/codegen/lib/utils.py similarity index 100% rename from code-generator/lib/utils.py rename to codegen/lib/utils.py diff --git a/code-generator/main.py b/codegen/newpacket.py similarity index 69% rename from code-generator/main.py rename to codegen/newpacket.py index 54ad3946..f4dc172e 100644 --- a/code-generator/main.py +++ b/codegen/newpacket.py @@ -1,11 +1,9 @@ -from .lib import version, packetcodegen -import requests -import json +from lib import download, packetcodegen # type: ignore import sys import os -mappings = version.get_mappings_for_version('1.18.2') -burger_data = version.get_burger_data_for_version('1.18.2') +mappings = download.get_mappings_for_version('1.18.2') +burger_data = download.get_burger_data_for_version('1.18.2') burger_packets_data = burger_data[0]['packets']['packet'] packet_id, direction, state = int(sys.argv[1]), sys.argv[2], sys.argv[3] From fb3b002d94076de463e2af776666387db9e75835 Mon Sep 17 00:00:00 2001 From: mat Date: Tue, 24 May 2022 23:05:44 -0500 Subject: [PATCH 03/27] start adding migrate --- codegen/burger.json | 1 - .../lib/{packetcodegen.py => code/packet.py} | 114 +++++++----------- codegen/lib/code/utils.py | 73 +++++++++++ codegen/lib/code/version.py | 31 +++++ codegen/lib/utils.py | 12 +- codegen/migrate.py | 52 ++++++++ codegen/newpacket.py | 8 +- 7 files changed, 212 insertions(+), 79 deletions(-) delete mode 100644 codegen/burger.json rename codegen/lib/{packetcodegen.py => code/packet.py} (64%) create mode 100644 codegen/lib/code/utils.py create mode 100644 codegen/lib/code/version.py create mode 100644 codegen/migrate.py diff --git a/codegen/burger.json b/codegen/burger.json deleted file mode 100644 index 4fa39aa3..00000000 --- a/codegen/burger.json +++ /dev/null @@ -1 +0,0 @@ -{"message": "Not Found", "documentation_url": "https://docs.github.com/rest/reference/repos#get-the-latest-release"} \ No newline at end of file diff --git a/codegen/lib/packetcodegen.py b/codegen/lib/code/packet.py similarity index 64% rename from codegen/lib/packetcodegen.py rename to codegen/lib/code/packet.py index b4c6a83b..0d3ad138 100644 --- a/codegen/lib/packetcodegen.py +++ b/codegen/lib/code/packet.py @@ -1,72 +1,10 @@ -from .utils import to_snake_case, to_camel_case -from .mappings import Mappings +from .utils import burger_type_to_rust_type, write_packet_file +from ..utils import padded_hex, to_snake_case, to_camel_case +from ..mappings import Mappings -def burger_type_to_rust_type(burger_type): - is_var = False - uses = set() - - if burger_type == 'byte': - field_type_rs = 'i8' - elif burger_type == 'short': - field_type_rs = 'i16' - elif burger_type == 'int': - field_type_rs = 'i32' - elif burger_type == 'long': - field_type_rs = 'i64' - elif burger_type == 'float': - field_type_rs = 'f32' - elif burger_type == 'double': - field_type_rs = 'f64' - - elif burger_type == 'varint': - is_var = True - field_type_rs = 'i32' - elif burger_type == 'varlong': - is_var = True - field_type_rs = 'i64' - - elif burger_type == 'boolean': - field_type_rs = 'bool' - elif burger_type == 'string': - field_type_rs = 'String' - - elif burger_type == 'chatcomponent': - field_type_rs = 'Component' - uses.add('azalea_chat::component::Component') - elif burger_type == 'identifier': - field_type_rs = 'ResourceLocation' - uses.add('azalea_core::resource_location::ResourceLocation') - elif burger_type == 'uuid': - field_type_rs = 'Uuid' - uses.add('uuid::Uuid') - elif burger_type == 'position': - field_type_rs = 'BlockPos' - uses.add('azalea_core::BlockPos') - elif burger_type == 'nbtcompound': - field_type_rs = 'azalea_nbt::Tag' - elif burger_type == 'itemstack': - field_type_rs = 'Slot' - uses.add('azalea_core::Slot') - elif burger_type == 'metadata': - field_type_rs = 'EntityMetadata' - uses.add('crate::mc_buf::EntityMetadata') - elif burger_type == 'enum': - # enums are too complicated, leave those to the user - field_type_rs = 'todo!()' - elif burger_type.endswith('[]'): - field_type_rs, is_var, uses = burger_type_to_rust_type( - burger_type[:-2]) - field_type_rs = f'Vec<{field_type_rs}>' - else: - print('Unknown field type:', burger_type) - exit() - return field_type_rs, is_var, uses - - -def write_packet_file(state, packet_name_snake_case, code): - with open(f'../azalea-protocol/src/packets/{state}/{packet_name_snake_case}.rs', 'w') as f: - f.write(code) +def make_packet_mod_rs_line(packet_id: int, packet_class_name: str): + return f' {padded_hex(packet_id)}: {to_snake_case(packet_class_name)}::{to_camel_case(packet_class_name)},' def generate(burger_packets, mappings: Mappings, target_packet_id, target_packet_direction, target_packet_state): @@ -138,7 +76,8 @@ def generate(burger_packets, mappings: Mappings, target_packet_id, target_packet pub_mod_line = f'pub mod {to_snake_case(class_name)};' if pub_mod_line not in mod_rs: mod_rs.insert(0, pub_mod_line) - packet_mod_rs_line = f' {hex(packet["id"])}: {to_snake_case(class_name)}::{to_camel_case(class_name)},' + packet_mod_rs_line = make_packet_mod_rs_line( + packet['id'], class_name) in_serverbound = False in_clientbound = False @@ -168,3 +107,42 @@ def generate(burger_packets, mappings: Mappings, target_packet_id, target_packet with open(mod_rs_dir, 'w') as f: f.write('\n'.join(mod_rs)) + + +def set_packet_ids(packet_ids: list, packet_class_names: list, direction: str, state: str): + assert len(packet_ids) == len(packet_class_names) + + mod_rs_dir = f'../azalea-protocol/src/packets/{state}/mod.rs' + with open(mod_rs_dir, 'r') as f: + mod_rs = f.read().splitlines() + new_mod_rs = [] + + ignore_lines = False + + for line in mod_rs: + if line.strip() == 'Serverbound => {': + if direction == 'serverbound': + ignore_lines = True + for packet_id, packet_class_name in zip(packet_ids, packet_class_names): + new_mod_rs.append( + make_packet_mod_rs_line(packet_id, packet_class_name) + ) + else: + ignore_lines = False + elif line.strip() == 'Clientbound => {': + if direction == 'serverbound': + ignore_lines = True + for packet_id, packet_class_name in zip(packet_ids, packet_class_names): + new_mod_rs.append( + make_packet_mod_rs_line(packet_id, packet_class_name) + ) + else: + ignore_lines = False + elif line.strip() in ('}', '},'): + ignore_lines = False + + if not ignore_lines: + new_mod_rs.append(line) + + with open(mod_rs_dir, 'w') as f: + f.write('\n'.join(new_mod_rs)) diff --git a/codegen/lib/code/utils.py b/codegen/lib/code/utils.py new file mode 100644 index 00000000..92d1a9e9 --- /dev/null +++ b/codegen/lib/code/utils.py @@ -0,0 +1,73 @@ + +import os + + +def burger_type_to_rust_type(burger_type): + is_var = False + uses = set() + + if burger_type == 'byte': + field_type_rs = 'i8' + elif burger_type == 'short': + field_type_rs = 'i16' + elif burger_type == 'int': + field_type_rs = 'i32' + elif burger_type == 'long': + field_type_rs = 'i64' + elif burger_type == 'float': + field_type_rs = 'f32' + elif burger_type == 'double': + field_type_rs = 'f64' + + elif burger_type == 'varint': + is_var = True + field_type_rs = 'i32' + elif burger_type == 'varlong': + is_var = True + field_type_rs = 'i64' + + elif burger_type == 'boolean': + field_type_rs = 'bool' + elif burger_type == 'string': + field_type_rs = 'String' + + elif burger_type == 'chatcomponent': + field_type_rs = 'Component' + uses.add('azalea_chat::component::Component') + elif burger_type == 'identifier': + field_type_rs = 'ResourceLocation' + uses.add('azalea_core::resource_location::ResourceLocation') + elif burger_type == 'uuid': + field_type_rs = 'Uuid' + uses.add('uuid::Uuid') + elif burger_type == 'position': + field_type_rs = 'BlockPos' + uses.add('azalea_core::BlockPos') + elif burger_type == 'nbtcompound': + field_type_rs = 'azalea_nbt::Tag' + elif burger_type == 'itemstack': + field_type_rs = 'Slot' + uses.add('azalea_core::Slot') + elif burger_type == 'metadata': + field_type_rs = 'EntityMetadata' + uses.add('crate::mc_buf::EntityMetadata') + elif burger_type == 'enum': + # enums are too complicated, leave those to the user + field_type_rs = 'todo!()' + elif burger_type.endswith('[]'): + field_type_rs, is_var, uses = burger_type_to_rust_type( + burger_type[:-2]) + field_type_rs = f'Vec<{field_type_rs}>' + else: + print('Unknown field type:', burger_type) + exit() + return field_type_rs, is_var, uses + + +def write_packet_file(state, packet_name_snake_case, code): + with open(f'../azalea-protocol/src/packets/{state}/{packet_name_snake_case}.rs', 'w') as f: + f.write(code) + + +def fmt(): + os.system('cd .. && cargo fmt') diff --git a/codegen/lib/code/version.py b/codegen/lib/code/version.py new file mode 100644 index 00000000..b7e5cbcc --- /dev/null +++ b/codegen/lib/code/version.py @@ -0,0 +1,31 @@ +import re + +README_DIR = '../README.md' +VERSION_REGEX = r'\*Currently supported Minecraft version: `(.*)`.\*' + + +def get_version_id() -> str: + with open(README_DIR, 'r') as f: + readme_text = f.read() + + version_line_match = re.search(VERSION_REGEX, readme_text) + if version_line_match: + version_id = version_line_match.group(1) + return version_id + else: + raise Exception('Could not find version id in README.md') + + +def set_version_id(version_id: str) -> None: + with open(README_DIR, 'r') as f: + readme_text = f.read() + + version_line_match = re.search(VERSION_REGEX, readme_text) + if version_line_match: + readme_text = readme_text.replace( + version_line_match.group(1), version_id) + else: + raise Exception('Could not find version id in README.md') + + with open(README_DIR, 'w') as f: + f.write(readme_text) diff --git a/codegen/lib/utils.py b/codegen/lib/utils.py index 5336d574..051ffe51 100644 --- a/codegen/lib/utils.py +++ b/codegen/lib/utils.py @@ -1,15 +1,15 @@ -import urllib.request -import gzip -import json import re -import io -def to_snake_case(name): +def to_snake_case(name: str): s = re.sub('([A-Z])', r'_\1', name) return s.lower().strip('_') -def to_camel_case(name): +def to_camel_case(name: str): s = re.sub('_([a-z])', lambda m: m.group(1).upper(), name) return s[0].upper() + s[1:] + + +def padded_hex(n: int): + return f'0x{n:02x}' diff --git a/codegen/migrate.py b/codegen/migrate.py new file mode 100644 index 00000000..c0748400 --- /dev/null +++ b/codegen/migrate.py @@ -0,0 +1,52 @@ +import lib.code.utils +import lib.code.version +import lib.download +import sys +import os + +old_version_id = lib.code.version.get_version_id() +old_mappings = lib.download.get_mappings_for_version(old_version_id) +old_burger_data = lib.download.get_burger_data_for_version(old_version_id) +old_packet_list = list(old_burger_data[0]['packets']['packet'].values()) + +new_version_id = sys.argv[1] +new_mappings = lib.download.get_mappings_for_version(new_version_id) +new_burger_data = lib.download.get_burger_data_for_version(new_version_id) +new_packet_list = list(new_burger_data[0]['packets']['packet'].values()) + +old_packet_ids = {} +new_packet_ids = {} + +for packet in old_packet_list: + assert packet['class'].endswith('.class') + packet_name = old_mappings.get_class(packet['class'][:-6]) + old_packet_ids[packet_name] = packet['id'] +for packet in new_packet_list: + assert packet['class'].endswith('.class') + packet_name = new_mappings.get_class(packet['class'][:-6]) + new_packet_ids[packet_name] = packet['id'] + +# find packets that changed ids +for packet_name in old_packet_ids: + if packet_name in new_packet_ids: + if old_packet_ids[packet_name] != new_packet_ids[packet_name]: + print(packet_name, 'id changed from', + old_packet_ids[packet_name], 'to', new_packet_ids[packet_name]) + +print() + +# find removed packets +for packet_name in old_packet_ids: + if packet_name not in new_packet_ids: + print(packet_name, 'removed') + +print() + +# find added packets +for packet_name in new_packet_ids: + if packet_name not in old_packet_ids: + print(packet_name, 'added') + +lib.code.utils.fmt() + +print('Done!') diff --git a/codegen/newpacket.py b/codegen/newpacket.py index f4dc172e..b3a1c64f 100644 --- a/codegen/newpacket.py +++ b/codegen/newpacket.py @@ -1,4 +1,4 @@ -from lib import download, packetcodegen # type: ignore +from lib import download, code # type: ignore import sys import os @@ -9,9 +9,9 @@ burger_packets_data = burger_data[0]['packets']['packet'] packet_id, direction, state = int(sys.argv[1]), sys.argv[2], sys.argv[3] print( f'Generating code for packet id: {packet_id} with direction {direction} and state {state}') -packetcodegen.generate(burger_packets_data, mappings, - packet_id, direction, state) +code.packetcodegen.generate(burger_packets_data, mappings, + packet_id, direction, state) -os.system('cd .. && cargo fmt') +code.fmt() print('Done!') From 479c05474704a5a2f68b79468d2cde05c0ceec62 Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 25 May 2022 00:21:05 -0500 Subject: [PATCH 04/27] Migrate might be working --- codegen/lib/code/packet.py | 72 ++++++++++++++++++++++++++++++++++++-- codegen/lib/code/utils.py | 2 ++ codegen/lib/utils.py | 25 +++++++++++++ codegen/migrate.py | 51 +++++++++++++++++---------- codegen/newpacket.py | 4 +-- 5 files changed, 132 insertions(+), 22 deletions(-) diff --git a/codegen/lib/code/packet.py b/codegen/lib/code/packet.py index 0d3ad138..59c773c1 100644 --- a/codegen/lib/code/packet.py +++ b/codegen/lib/code/packet.py @@ -7,7 +7,7 @@ def make_packet_mod_rs_line(packet_id: int, packet_class_name: str): return f' {padded_hex(packet_id)}: {to_snake_case(packet_class_name)}::{to_camel_case(packet_class_name)},' -def generate(burger_packets, mappings: Mappings, target_packet_id, target_packet_direction, target_packet_state): +def generate_packet(burger_packets, mappings: Mappings, target_packet_id, target_packet_direction, target_packet_state): for packet in burger_packets.values(): if packet['id'] != target_packet_id: continue @@ -109,9 +109,13 @@ def generate(burger_packets, mappings: Mappings, target_packet_id, target_packet f.write('\n'.join(mod_rs)) -def set_packet_ids(packet_ids: list, packet_class_names: list, direction: str, state: str): +def set_packets(packet_ids: list, packet_class_names: list, direction: str, state: str): assert len(packet_ids) == len(packet_class_names) + # sort the packets by id + packet_ids, packet_class_names = [list(x) for x in zip( + *sorted(zip(packet_ids, packet_class_names), key=lambda pair: pair[0]))] + mod_rs_dir = f'../azalea-protocol/src/packets/{state}/mod.rs' with open(mod_rs_dir, 'r') as f: mod_rs = f.read().splitlines() @@ -146,3 +150,67 @@ def set_packet_ids(packet_ids: list, packet_class_names: list, direction: str, s with open(mod_rs_dir, 'w') as f: f.write('\n'.join(new_mod_rs)) + + +def get_packets(direction: str, state: str): + mod_rs_dir = f'../azalea-protocol/src/packets/{state}/mod.rs' + with open(mod_rs_dir, 'r') as f: + mod_rs = f.read().splitlines() + + in_serverbound = False + in_clientbound = False + + packet_ids: list[int] = [] + packet_class_names: list[str] = [] + + for line in mod_rs: + if line.strip() == 'Serverbound => {': + in_serverbound = True + continue + elif line.strip() == 'Clientbound => {': + in_clientbound = True + continue + elif line.strip() in ('}', '},'): + if (in_serverbound and direction == 'serverbound') or (in_clientbound and direction == 'clientbound'): + break + in_serverbound = in_clientbound = False + continue + + if line.strip() == '' or line.strip().startswith('//') or (not in_serverbound and direction == 'serverbound') or (not in_clientbound and direction == 'clientbound'): + continue + + line_packet_id_hex = line.strip().split(':')[0] + assert line_packet_id_hex.startswith('0x') + line_packet_id = int(line_packet_id_hex[2:], 16) + packet_ids.append(line_packet_id) + + packet_class_name = line.strip().split(':')[1].strip() + packet_class_names.append(packet_class_name) + + return packet_ids, packet_class_names + + +def change_packet_ids(id_map: dict[int, int], direction: str, state: str): + existing_packet_ids, existing_packet_class_names = get_packets( + direction, state) + + new_packet_ids = [] + + for packet_id in existing_packet_ids: + new_packet_id = id_map.get(packet_id, packet_id) + new_packet_ids.append(new_packet_id) + + set_packets(new_packet_ids, existing_packet_class_names, direction, state) + + +def remove_packet_ids(packet_ids: list[int], direction: str, state: str): + existing_packet_ids, existing_packet_class_names = get_packets( + direction, state) + + new_packet_ids = [] + + for packet_id in existing_packet_ids: + if packet_id not in packet_ids: + new_packet_ids.append(packet_id) + + set_packets(new_packet_ids, existing_packet_class_names, direction, state) diff --git a/codegen/lib/code/utils.py b/codegen/lib/code/utils.py index 92d1a9e9..28a5ef3c 100644 --- a/codegen/lib/code/utils.py +++ b/codegen/lib/code/utils.py @@ -1,6 +1,8 @@ import os +# utilities specifically for codegen + def burger_type_to_rust_type(burger_type): is_var = False diff --git a/codegen/lib/utils.py b/codegen/lib/utils.py index 051ffe51..ff1a5d36 100644 --- a/codegen/lib/utils.py +++ b/codegen/lib/utils.py @@ -1,5 +1,7 @@ import re +# utilities that could be used for things other than codegen + def to_snake_case(name: str): s = re.sub('([A-Z])', r'_\1', name) @@ -13,3 +15,26 @@ def to_camel_case(name: str): def padded_hex(n: int): return f'0x{n:02x}' + + +class PacketIdentifier: + def __init__(self, packet_id, direction, state): + self.packet_id = packet_id + self.direction = direction + self.state = state + + def __eq__(self, other): + return self.packet_id == other.packet_id and self.direction == other.direction and self.state == other.state + + def __hash__(self): + return hash((self.packet_id, self.direction, self.state)) + + +def group_packets(packets: list[PacketIdentifier]): + packet_groups: dict[tuple[str, str], list[int]] = {} + for packet in packets: + key = (packet.direction, packet.state) + if key not in packet_groups: + packet_groups[key] = [] + packet_groups[key].append(packet.packet_id) + return packet_groups diff --git a/codegen/migrate.py b/codegen/migrate.py index c0748400..6928cea1 100644 --- a/codegen/migrate.py +++ b/codegen/migrate.py @@ -1,5 +1,7 @@ +from codegen.lib.utils import PacketIdentifier, group_packets import lib.code.utils import lib.code.version +import lib.code.packet import lib.download import sys import os @@ -14,39 +16,52 @@ new_mappings = lib.download.get_mappings_for_version(new_version_id) new_burger_data = lib.download.get_burger_data_for_version(new_version_id) new_packet_list = list(new_burger_data[0]['packets']['packet'].values()) -old_packet_ids = {} -new_packet_ids = {} + +old_packets: dict[PacketIdentifier, str] = {} +new_packets: dict[PacketIdentifier, str] = {} for packet in old_packet_list: assert packet['class'].endswith('.class') packet_name = old_mappings.get_class(packet['class'][:-6]) - old_packet_ids[packet_name] = packet['id'] + old_packets[PacketIdentifier( + packet['id'], packet['direction'], packet['state'])] = packet_name for packet in new_packet_list: assert packet['class'].endswith('.class') packet_name = new_mappings.get_class(packet['class'][:-6]) - new_packet_ids[packet_name] = packet['id'] + new_packets[PacketIdentifier( + packet['id'], packet['direction'], packet['state'])] = packet_name -# find packets that changed ids -for packet_name in old_packet_ids: - if packet_name in new_packet_ids: - if old_packet_ids[packet_name] != new_packet_ids[packet_name]: - print(packet_name, 'id changed from', - old_packet_ids[packet_name], 'to', new_packet_ids[packet_name]) + +# find removed packets +removed_packets: list[PacketIdentifier] = [] +for packet in old_packets: + if packet not in new_packets: + removed_packets.append(packet) +for (direction, state), packets in group_packets(removed_packets).items(): + lib.code.packet.remove_packet_ids(packets, direction, state) print() -# find removed packets -for packet_name in old_packet_ids: - if packet_name not in new_packet_ids: - print(packet_name, 'removed') +# find packets that changed ids +changed_packets: dict[PacketIdentifier, int] = {} +for old_packet, old_packet_name in old_packets.items(): + for new_packet, new_packet_name in new_packets.items(): + if old_packet == new_packet and old_packet.packet_id != new_packet.packet_id: + changed_packets[old_packet] = new_packet.packet_id +for (direction, state), packets in group_packets(list(changed_packets.keys())).items(): + lib.code.packet.remove_packet_ids(packets, direction, state) + print() # find added packets -for packet_name in new_packet_ids: - if packet_name not in old_packet_ids: - print(packet_name, 'added') - +added_packets: list[PacketIdentifier] = [] +for packet in new_packets: + if packet not in old_packets: + added_packets.append(packet) +for packet in added_packets: + lib.code.packet.generate_packet( + new_burger_data, new_mappings, packet.packet_id, packet.direction, packet.state) lib.code.utils.fmt() print('Done!') diff --git a/codegen/newpacket.py b/codegen/newpacket.py index b3a1c64f..2e4c77d7 100644 --- a/codegen/newpacket.py +++ b/codegen/newpacket.py @@ -9,8 +9,8 @@ burger_packets_data = burger_data[0]['packets']['packet'] packet_id, direction, state = int(sys.argv[1]), sys.argv[2], sys.argv[3] print( f'Generating code for packet id: {packet_id} with direction {direction} and state {state}') -code.packetcodegen.generate(burger_packets_data, mappings, - packet_id, direction, state) +code.packetcodegen.generate_packet(burger_packets_data, mappings, + packet_id, direction, state) code.fmt() From dc5a9149a588f727f14f7d6d89908ba8fe87b642 Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 25 May 2022 00:30:47 -0500 Subject: [PATCH 05/27] Fix migrate --- codegen/lib/utils.py | 8 +++++++- codegen/migrate.py | 17 ++++++++++------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/codegen/lib/utils.py b/codegen/lib/utils.py index ff1a5d36..c185c0e5 100644 --- a/codegen/lib/utils.py +++ b/codegen/lib/utils.py @@ -18,7 +18,7 @@ def padded_hex(n: int): class PacketIdentifier: - def __init__(self, packet_id, direction, state): + def __init__(self, packet_id: int, direction: str, state: str): self.packet_id = packet_id self.direction = direction self.state = state @@ -29,6 +29,12 @@ class PacketIdentifier: def __hash__(self): return hash((self.packet_id, self.direction, self.state)) + def __str__(self): + return f'{self.packet_id} {self.direction} {self.state}' + + def __repr__(self): + return f'PacketIdentifier({self.packet_id}, {self.direction}, {self.state})' + def group_packets(packets: list[PacketIdentifier]): packet_groups: dict[tuple[str, str], list[int]] = {} diff --git a/codegen/migrate.py b/codegen/migrate.py index 6928cea1..7cd46058 100644 --- a/codegen/migrate.py +++ b/codegen/migrate.py @@ -1,4 +1,4 @@ -from codegen.lib.utils import PacketIdentifier, group_packets +from lib.utils import PacketIdentifier, group_packets import lib.code.utils import lib.code.version import lib.code.packet @@ -24,19 +24,19 @@ for packet in old_packet_list: assert packet['class'].endswith('.class') packet_name = old_mappings.get_class(packet['class'][:-6]) old_packets[PacketIdentifier( - packet['id'], packet['direction'], packet['state'])] = packet_name + packet['id'], packet['direction'].lower(), packet['state'].lower())] = packet_name for packet in new_packet_list: assert packet['class'].endswith('.class') packet_name = new_mappings.get_class(packet['class'][:-6]) new_packets[PacketIdentifier( - packet['id'], packet['direction'], packet['state'])] = packet_name - + packet['id'], packet['direction'].lower(), packet['state'].lower())] = packet_name # find removed packets removed_packets: list[PacketIdentifier] = [] for packet in old_packets: - if packet not in new_packets: + if packet not in new_packets or new_packets[packet] != old_packets[packet]: removed_packets.append(packet) + print('Removed packet:', packet) for (direction, state), packets in group_packets(removed_packets).items(): lib.code.packet.remove_packet_ids(packets, direction, state) @@ -48,6 +48,8 @@ for old_packet, old_packet_name in old_packets.items(): for new_packet, new_packet_name in new_packets.items(): if old_packet == new_packet and old_packet.packet_id != new_packet.packet_id: changed_packets[old_packet] = new_packet.packet_id + print('Changed packet id:', old_packet, '->', + new_packet, f'({new_packet_name})') for (direction, state), packets in group_packets(list(changed_packets.keys())).items(): lib.code.packet.remove_packet_ids(packets, direction, state) @@ -57,11 +59,12 @@ print() # find added packets added_packets: list[PacketIdentifier] = [] for packet in new_packets: - if packet not in old_packets: + if packet not in old_packets and new_packets[packet] == old_packets[packet]: added_packets.append(packet) + print('Added packet:', packet) for packet in added_packets: lib.code.packet.generate_packet( - new_burger_data, new_mappings, packet.packet_id, packet.direction, packet.state) + new_burger_data[0]['packets']['packet'], new_mappings, packet.packet_id, packet.direction, packet.state) lib.code.utils.fmt() print('Done!') From 8953cf43e25ca93103fbc3551ac658e1b56679df Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 25 May 2022 00:35:53 -0500 Subject: [PATCH 06/27] Almost --- codegen/lib/code/packet.py | 22 ++++++++++++++-------- codegen/migrate.py | 5 +++-- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/codegen/lib/code/packet.py b/codegen/lib/code/packet.py index 59c773c1..f9135194 100644 --- a/codegen/lib/code/packet.py +++ b/codegen/lib/code/packet.py @@ -7,13 +7,17 @@ def make_packet_mod_rs_line(packet_id: int, packet_class_name: str): return f' {padded_hex(packet_id)}: {to_snake_case(packet_class_name)}::{to_camel_case(packet_class_name)},' +def fix_state(state: str): + return {'PLAY': 'game'}.get(state, state.lower()) + + def generate_packet(burger_packets, mappings: Mappings, target_packet_id, target_packet_direction, target_packet_state): for packet in burger_packets.values(): if packet['id'] != target_packet_id: continue direction = packet['direction'].lower() # serverbound or clientbound - state = {'PLAY': 'game'}.get(packet['state'], packet['state'].lower()) + state = fix_state(packet['state']) if state != target_packet_state or direction != target_packet_direction: continue @@ -109,12 +113,12 @@ def generate_packet(burger_packets, mappings: Mappings, target_packet_id, target f.write('\n'.join(mod_rs)) -def set_packets(packet_ids: list, packet_class_names: list, direction: str, state: str): +def set_packets(packet_ids: list[int], packet_class_names: list[str], direction: str, state: str): assert len(packet_ids) == len(packet_class_names) # sort the packets by id - packet_ids, packet_class_names = [list(x) for x in zip( - *sorted(zip(packet_ids, packet_class_names), key=lambda pair: pair[0]))] + zipped_packets: list[tuple[int, str]] = [list(x) for x in zip( + *sorted(zip(packet_ids, packet_class_names), key=lambda pair: pair[0]))] # type: ignore mod_rs_dir = f'../azalea-protocol/src/packets/{state}/mod.rs' with open(mod_rs_dir, 'r') as f: @@ -127,7 +131,7 @@ def set_packets(packet_ids: list, packet_class_names: list, direction: str, stat if line.strip() == 'Serverbound => {': if direction == 'serverbound': ignore_lines = True - for packet_id, packet_class_name in zip(packet_ids, packet_class_names): + for packet_id, packet_class_name in zipped_packets: new_mod_rs.append( make_packet_mod_rs_line(packet_id, packet_class_name) ) @@ -136,7 +140,7 @@ def set_packets(packet_ids: list, packet_class_names: list, direction: str, stat elif line.strip() == 'Clientbound => {': if direction == 'serverbound': ignore_lines = True - for packet_id, packet_class_name in zip(packet_ids, packet_class_names): + for packet_id, packet_class_name in zipped_packets: new_mod_rs.append( make_packet_mod_rs_line(packet_id, packet_class_name) ) @@ -208,9 +212,11 @@ def remove_packet_ids(packet_ids: list[int], direction: str, state: str): direction, state) new_packet_ids = [] + new_packet_class_names = [] - for packet_id in existing_packet_ids: + for packet_id, packet_class_name in zip(existing_packet_ids, existing_packet_class_names): if packet_id not in packet_ids: new_packet_ids.append(packet_id) + new_packet_class_names.append(packet_class_name) - set_packets(new_packet_ids, existing_packet_class_names, direction, state) + set_packets(new_packet_ids, new_packet_class_names, direction, state) diff --git a/codegen/migrate.py b/codegen/migrate.py index 7cd46058..edcf85a7 100644 --- a/codegen/migrate.py +++ b/codegen/migrate.py @@ -1,3 +1,4 @@ +from lib.code.packet import fix_state from lib.utils import PacketIdentifier, group_packets import lib.code.utils import lib.code.version @@ -24,12 +25,12 @@ for packet in old_packet_list: assert packet['class'].endswith('.class') packet_name = old_mappings.get_class(packet['class'][:-6]) old_packets[PacketIdentifier( - packet['id'], packet['direction'].lower(), packet['state'].lower())] = packet_name + packet['id'], packet['direction'].lower(), fix_state(packet['state']))] = packet_name for packet in new_packet_list: assert packet['class'].endswith('.class') packet_name = new_mappings.get_class(packet['class'][:-6]) new_packets[PacketIdentifier( - packet['id'], packet['direction'].lower(), packet['state'].lower())] = packet_name + packet['id'], packet['direction'].lower(), fix_state(packet['state']))] = packet_name # find removed packets removed_packets: list[PacketIdentifier] = [] From 856353458cfcc60b5071bdd66ae8176bd3d2287e Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 25 May 2022 00:38:27 -0500 Subject: [PATCH 07/27] don't error --- codegen/migrate.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/codegen/migrate.py b/codegen/migrate.py index edcf85a7..75cbe122 100644 --- a/codegen/migrate.py +++ b/codegen/migrate.py @@ -34,8 +34,8 @@ for packet in new_packet_list: # find removed packets removed_packets: list[PacketIdentifier] = [] -for packet in old_packets: - if packet not in new_packets or new_packets[packet] != old_packets[packet]: +for packet, packet_name in old_packets.items(): + if packet_name not in old_packets.values(): removed_packets.append(packet) print('Removed packet:', packet) for (direction, state), packets in group_packets(removed_packets).items(): @@ -59,8 +59,8 @@ print() # find added packets added_packets: list[PacketIdentifier] = [] -for packet in new_packets: - if packet not in old_packets and new_packets[packet] == old_packets[packet]: +for packet, packet_name in new_packets.items(): + if packet_name not in old_packets.values(): added_packets.append(packet) print('Added packet:', packet) for packet in added_packets: From 2b34df21885a46f6b71c1c66a332f51d81f73044 Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 25 May 2022 00:39:33 -0500 Subject: [PATCH 08/27] Update migrate.py --- codegen/migrate.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/codegen/migrate.py b/codegen/migrate.py index 75cbe122..304351d3 100644 --- a/codegen/migrate.py +++ b/codegen/migrate.py @@ -47,10 +47,11 @@ print() changed_packets: dict[PacketIdentifier, int] = {} for old_packet, old_packet_name in old_packets.items(): for new_packet, new_packet_name in new_packets.items(): - if old_packet == new_packet and old_packet.packet_id != new_packet.packet_id: + if old_packet.direction == new_packet.direction and old_packet.state == new_packet.state and old_packet.packet_id != new_packet.packet_id: changed_packets[old_packet] = new_packet.packet_id print('Changed packet id:', old_packet, '->', new_packet, f'({new_packet_name})') + break for (direction, state), packets in group_packets(list(changed_packets.keys())).items(): lib.code.packet.remove_packet_ids(packets, direction, state) From d69f4445f31b0093d233fc052735c772bdab16b1 Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 25 May 2022 00:40:23 -0500 Subject: [PATCH 09/27] Update packet.py --- codegen/lib/code/packet.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/codegen/lib/code/packet.py b/codegen/lib/code/packet.py index f9135194..af41a390 100644 --- a/codegen/lib/code/packet.py +++ b/codegen/lib/code/packet.py @@ -129,6 +129,7 @@ def set_packets(packet_ids: list[int], packet_class_names: list[str], direction: for line in mod_rs: if line.strip() == 'Serverbound => {': + new_mod_rs.append(line) if direction == 'serverbound': ignore_lines = True for packet_id, packet_class_name in zipped_packets: @@ -137,7 +138,9 @@ def set_packets(packet_ids: list[int], packet_class_names: list[str], direction: ) else: ignore_lines = False + continue elif line.strip() == 'Clientbound => {': + new_mod_rs.append(line) if direction == 'serverbound': ignore_lines = True for packet_id, packet_class_name in zipped_packets: @@ -146,6 +149,7 @@ def set_packets(packet_ids: list[int], packet_class_names: list[str], direction: ) else: ignore_lines = False + continue elif line.strip() in ('}', '},'): ignore_lines = False From c851204dd0c4b9eee8acc12c4de56b90e1bf041b Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 25 May 2022 20:09:48 -0500 Subject: [PATCH 10/27] Fix detecting changed packet ids --- codegen/lib/download.py | 8 ++++++-- codegen/migrate.py | 16 ++++++++-------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/codegen/lib/download.py b/codegen/lib/download.py index 284591ab..5030f8f3 100644 --- a/codegen/lib/download.py +++ b/codegen/lib/download.py @@ -41,8 +41,12 @@ def get_version_data(version_id: str): print( f'\033[92mGetting data for \033[1m{version_id}..\033[m') - package_url = next( - filter(lambda v: v['id'] == version_id, version_manifest_data['versions']))['url'] + try: + package_url = next( + filter(lambda v: v['id'] == version_id, version_manifest_data['versions']))['url'] + except StopIteration: + raise ValueError( + f'No version with id {version_id} found. Maybe delete downloads/version_manifest.json and try again?') package_data = requests.get(package_url).json() with open(f'downloads/{version_id}.json', 'w') as f: json.dump(package_data, f) diff --git a/codegen/migrate.py b/codegen/migrate.py index 304351d3..c623fd58 100644 --- a/codegen/migrate.py +++ b/codegen/migrate.py @@ -38,8 +38,8 @@ for packet, packet_name in old_packets.items(): if packet_name not in old_packets.values(): removed_packets.append(packet) print('Removed packet:', packet) -for (direction, state), packets in group_packets(removed_packets).items(): - lib.code.packet.remove_packet_ids(packets, direction, state) +# for (direction, state), packets in group_packets(removed_packets).items(): +# lib.code.packet.remove_packet_ids(packets, direction, state) print() @@ -47,13 +47,13 @@ print() changed_packets: dict[PacketIdentifier, int] = {} for old_packet, old_packet_name in old_packets.items(): for new_packet, new_packet_name in new_packets.items(): - if old_packet.direction == new_packet.direction and old_packet.state == new_packet.state and old_packet.packet_id != new_packet.packet_id: + if old_packet_name == new_packet_name and old_packet.direction == new_packet.direction and old_packet.state == new_packet.state and old_packet.packet_id != new_packet.packet_id: changed_packets[old_packet] = new_packet.packet_id print('Changed packet id:', old_packet, '->', new_packet, f'({new_packet_name})') break -for (direction, state), packets in group_packets(list(changed_packets.keys())).items(): - lib.code.packet.remove_packet_ids(packets, direction, state) +# for (direction, state), packets in group_packets(list(changed_packets.keys())).items(): +# lib.code.packet.remove_packet_ids(packets, direction, state) print() @@ -64,9 +64,9 @@ for packet, packet_name in new_packets.items(): if packet_name not in old_packets.values(): added_packets.append(packet) print('Added packet:', packet) -for packet in added_packets: - lib.code.packet.generate_packet( - new_burger_data[0]['packets']['packet'], new_mappings, packet.packet_id, packet.direction, packet.state) +# for packet in added_packets: +# lib.code.packet.generate_packet( +# new_burger_data[0]['packets']['packet'], new_mappings, packet.packet_id, packet.direction, packet.state) lib.code.utils.fmt() print('Done!') From 9f192301facdb35157c5de105f6390b2de317ac4 Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 25 May 2022 20:18:03 -0500 Subject: [PATCH 11/27] Fix removed packets --- codegen/migrate.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/codegen/migrate.py b/codegen/migrate.py index c623fd58..f15844d9 100644 --- a/codegen/migrate.py +++ b/codegen/migrate.py @@ -35,9 +35,9 @@ for packet in new_packet_list: # find removed packets removed_packets: list[PacketIdentifier] = [] for packet, packet_name in old_packets.items(): - if packet_name not in old_packets.values(): + if packet_name not in new_packets.values(): removed_packets.append(packet) - print('Removed packet:', packet) + print('Removed packet:', packet, packet_name) # for (direction, state), packets in group_packets(removed_packets).items(): # lib.code.packet.remove_packet_ids(packets, direction, state) @@ -63,7 +63,7 @@ added_packets: list[PacketIdentifier] = [] for packet, packet_name in new_packets.items(): if packet_name not in old_packets.values(): added_packets.append(packet) - print('Added packet:', packet) + print('Added packet:', packet, packet_name) # for packet in added_packets: # lib.code.packet.generate_packet( # new_burger_data[0]['packets']['packet'], new_mappings, packet.packet_id, packet.direction, packet.state) From 9d0de818f8306a401efcd9244c6e06aa5e8189db Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 25 May 2022 20:21:50 -0500 Subject: [PATCH 12/27] fixed changing packet ids --- codegen/migrate.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/codegen/migrate.py b/codegen/migrate.py index f15844d9..890186b8 100644 --- a/codegen/migrate.py +++ b/codegen/migrate.py @@ -38,8 +38,8 @@ for packet, packet_name in old_packets.items(): if packet_name not in new_packets.values(): removed_packets.append(packet) print('Removed packet:', packet, packet_name) -# for (direction, state), packets in group_packets(removed_packets).items(): -# lib.code.packet.remove_packet_ids(packets, direction, state) +for (direction, state), packets in group_packets(removed_packets).items(): + lib.code.packet.remove_packet_ids(packets, direction, state) print() @@ -52,8 +52,14 @@ for old_packet, old_packet_name in old_packets.items(): print('Changed packet id:', old_packet, '->', new_packet, f'({new_packet_name})') break -# for (direction, state), packets in group_packets(list(changed_packets.keys())).items(): -# lib.code.packet.remove_packet_ids(packets, direction, state) +for (direction, state), packets in group_packets(list(changed_packets.keys())).items(): + id_map: dict[int, int] = {} + for old_packet_id in packets: + new_packet_id = changed_packets[PacketIdentifier( + old_packet_id, direction, state)] + id_map[old_packet_id] = new_packet_id + + lib.code.packet.change_packet_ids(id_map, direction, state) print() @@ -64,9 +70,9 @@ for packet, packet_name in new_packets.items(): if packet_name not in old_packets.values(): added_packets.append(packet) print('Added packet:', packet, packet_name) -# for packet in added_packets: -# lib.code.packet.generate_packet( -# new_burger_data[0]['packets']['packet'], new_mappings, packet.packet_id, packet.direction, packet.state) +for packet in added_packets: + lib.code.packet.generate_packet( + new_burger_data[0]['packets']['packet'], new_mappings, packet.packet_id, packet.direction, packet.state) lib.code.utils.fmt() print('Done!') From 054c6e678bc015f674c2d15cb6432a46d81d5934 Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 25 May 2022 20:24:41 -0500 Subject: [PATCH 13/27] fix set_packets maybe --- codegen/lib/code/packet.py | 6 +++--- codegen/migrate.py | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/codegen/lib/code/packet.py b/codegen/lib/code/packet.py index af41a390..8563e5b9 100644 --- a/codegen/lib/code/packet.py +++ b/codegen/lib/code/packet.py @@ -117,7 +117,7 @@ def set_packets(packet_ids: list[int], packet_class_names: list[str], direction: assert len(packet_ids) == len(packet_class_names) # sort the packets by id - zipped_packets: list[tuple[int, str]] = [list(x) for x in zip( + packet_ids, packet_class_names = [list(x) for x in zip( *sorted(zip(packet_ids, packet_class_names), key=lambda pair: pair[0]))] # type: ignore mod_rs_dir = f'../azalea-protocol/src/packets/{state}/mod.rs' @@ -132,7 +132,7 @@ def set_packets(packet_ids: list[int], packet_class_names: list[str], direction: new_mod_rs.append(line) if direction == 'serverbound': ignore_lines = True - for packet_id, packet_class_name in zipped_packets: + for packet_id, packet_class_name in zip(packet_ids, packet_class_names): new_mod_rs.append( make_packet_mod_rs_line(packet_id, packet_class_name) ) @@ -143,7 +143,7 @@ def set_packets(packet_ids: list[int], packet_class_names: list[str], direction: new_mod_rs.append(line) if direction == 'serverbound': ignore_lines = True - for packet_id, packet_class_name in zipped_packets: + for packet_id, packet_class_name in zip(packet_ids, packet_class_names): new_mod_rs.append( make_packet_mod_rs_line(packet_id, packet_class_name) ) diff --git a/codegen/migrate.py b/codegen/migrate.py index 890186b8..392af9fe 100644 --- a/codegen/migrate.py +++ b/codegen/migrate.py @@ -58,7 +58,6 @@ for (direction, state), packets in group_packets(list(changed_packets.keys())).i new_packet_id = changed_packets[PacketIdentifier( old_packet_id, direction, state)] id_map[old_packet_id] = new_packet_id - lib.code.packet.change_packet_ids(id_map, direction, state) From 35511e83c3fc0d655686790ad662593f0406630a Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 25 May 2022 20:28:46 -0500 Subject: [PATCH 14/27] more fix --- azalea-protocol/src/packets/game/mod.rs | 2 +- codegen/lib/code/packet.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/azalea-protocol/src/packets/game/mod.rs b/azalea-protocol/src/packets/game/mod.rs index 883e03aa..7372435a 100755 --- a/azalea-protocol/src/packets/game/mod.rs +++ b/azalea-protocol/src/packets/game/mod.rs @@ -103,4 +103,4 @@ declare_state_packets!( 0x66: clientbound_update_recipes_packet::ClientboundUpdateRecipesPacket, 0x67: clientbound_update_tags_packet::ClientboundUpdateTagsPacket, } -); +); \ No newline at end of file diff --git a/codegen/lib/code/packet.py b/codegen/lib/code/packet.py index 8563e5b9..427a2f3e 100644 --- a/codegen/lib/code/packet.py +++ b/codegen/lib/code/packet.py @@ -141,7 +141,7 @@ def set_packets(packet_ids: list[int], packet_class_names: list[str], direction: continue elif line.strip() == 'Clientbound => {': new_mod_rs.append(line) - if direction == 'serverbound': + if direction == 'clientbound': ignore_lines = True for packet_id, packet_class_name in zip(packet_ids, packet_class_names): new_mod_rs.append( @@ -211,7 +211,7 @@ def change_packet_ids(id_map: dict[int, int], direction: str, state: str): set_packets(new_packet_ids, existing_packet_class_names, direction, state) -def remove_packet_ids(packet_ids: list[int], direction: str, state: str): +def remove_packet_ids(removing_packet_ids: list[int], direction: str, state: str): existing_packet_ids, existing_packet_class_names = get_packets( direction, state) @@ -219,7 +219,7 @@ def remove_packet_ids(packet_ids: list[int], direction: str, state: str): new_packet_class_names = [] for packet_id, packet_class_name in zip(existing_packet_ids, existing_packet_class_names): - if packet_id not in packet_ids: + if packet_id not in removing_packet_ids: new_packet_ids.append(packet_id) new_packet_class_names.append(packet_class_name) From 03c50bf22b731dd0d6ab92b789a63a4c80d163bb Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 25 May 2022 20:30:34 -0500 Subject: [PATCH 15/27] delete files of removed packets --- codegen/lib/code/packet.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/codegen/lib/code/packet.py b/codegen/lib/code/packet.py index 427a2f3e..5d073d2b 100644 --- a/codegen/lib/code/packet.py +++ b/codegen/lib/code/packet.py @@ -1,6 +1,7 @@ from .utils import burger_type_to_rust_type, write_packet_file from ..utils import padded_hex, to_snake_case, to_camel_case from ..mappings import Mappings +import os def make_packet_mod_rs_line(packet_id: int, packet_class_name: str): @@ -222,5 +223,7 @@ def remove_packet_ids(removing_packet_ids: list[int], direction: str, state: str if packet_id not in removing_packet_ids: new_packet_ids.append(packet_id) new_packet_class_names.append(packet_class_name) + os.remove( + f'../azalea-protocol/src/packets/{state}/{packet_class_name}.rs') set_packets(new_packet_ids, new_packet_class_names, direction, state) From 053e5375b548c17bda126fa01e2ddce05f81ded5 Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 25 May 2022 22:49:29 -0500 Subject: [PATCH 16/27] Update packet.py --- codegen/lib/code/packet.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/codegen/lib/code/packet.py b/codegen/lib/code/packet.py index 5d073d2b..58cf8c38 100644 --- a/codegen/lib/code/packet.py +++ b/codegen/lib/code/packet.py @@ -126,7 +126,10 @@ def set_packets(packet_ids: list[int], packet_class_names: list[str], direction: mod_rs = f.read().splitlines() new_mod_rs = [] - ignore_lines = False + required_modules = [] + + # set to true by default to ignore the `pub mod` lines since we add these later + ignore_lines = True for line in mod_rs: if line.strip() == 'Serverbound => {': @@ -137,6 +140,7 @@ def set_packets(packet_ids: list[int], packet_class_names: list[str], direction: new_mod_rs.append( make_packet_mod_rs_line(packet_id, packet_class_name) ) + required_modules.append(packet_class_name) else: ignore_lines = False continue @@ -156,6 +160,14 @@ def set_packets(packet_ids: list[int], packet_class_names: list[str], direction: if not ignore_lines: new_mod_rs.append(line) + # 0x00: clientbound_status_response_packet::ClientboundStatusResponsePacket, + if line.strip().startswith('0x'): + required_modules.append( + line.strip().split(':')[1].split('::')[0]) + + for i, required_module in enumerate(required_modules): + if required_module not in mod_rs: + new_mod_rs.insert(i, f'pub mod {required_module};') with open(mod_rs_dir, 'w') as f: f.write('\n'.join(new_mod_rs)) @@ -223,7 +235,5 @@ def remove_packet_ids(removing_packet_ids: list[int], direction: str, state: str if packet_id not in removing_packet_ids: new_packet_ids.append(packet_id) new_packet_class_names.append(packet_class_name) - os.remove( - f'../azalea-protocol/src/packets/{state}/{packet_class_name}.rs') set_packets(new_packet_ids, new_packet_class_names, direction, state) From 64eaa63e2368a2d26c5f8d843bd1642539670c70 Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 25 May 2022 22:54:49 -0500 Subject: [PATCH 17/27] Migrate mod.rs works --- codegen/lib/code/packet.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/codegen/lib/code/packet.py b/codegen/lib/code/packet.py index 58cf8c38..36e0ba0c 100644 --- a/codegen/lib/code/packet.py +++ b/codegen/lib/code/packet.py @@ -128,8 +128,7 @@ def set_packets(packet_ids: list[int], packet_class_names: list[str], direction: required_modules = [] - # set to true by default to ignore the `pub mod` lines since we add these later - ignore_lines = True + ignore_lines = False for line in mod_rs: if line.strip() == 'Serverbound => {': @@ -157,13 +156,15 @@ def set_packets(packet_ids: list[int], packet_class_names: list[str], direction: continue elif line.strip() in ('}', '},'): ignore_lines = False + elif line.strip().startswith('pub mod '): + continue if not ignore_lines: new_mod_rs.append(line) # 0x00: clientbound_status_response_packet::ClientboundStatusResponsePacket, if line.strip().startswith('0x'): required_modules.append( - line.strip().split(':')[1].split('::')[0]) + line.strip().split(':')[1].split('::')[0].strip()) for i, required_module in enumerate(required_modules): if required_module not in mod_rs: @@ -232,7 +233,13 @@ def remove_packet_ids(removing_packet_ids: list[int], direction: str, state: str new_packet_class_names = [] for packet_id, packet_class_name in zip(existing_packet_ids, existing_packet_class_names): - if packet_id not in removing_packet_ids: + if packet_id in removing_packet_ids: + try: + os.remove( + f'../azalea-protocol/src/packets/{state}/{packet_class_name}.rs') + except: + pass + else: new_packet_ids.append(packet_id) new_packet_class_names.append(packet_class_name) From 3fbbb61c30f0833dd1e07802419ee91ef6cad8e3 Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 25 May 2022 22:59:05 -0500 Subject: [PATCH 18/27] set version ids --- codegen/lib/code/version.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/codegen/lib/code/version.py b/codegen/lib/code/version.py index b7e5cbcc..77911f16 100644 --- a/codegen/lib/code/version.py +++ b/codegen/lib/code/version.py @@ -29,3 +29,26 @@ def set_version_id(version_id: str) -> None: with open(README_DIR, 'w') as f: f.write(readme_text) + +def get_protocol_version() -> str: + # azalea-protocol/src/packets/mod.rs + # pub const PROTOCOL_VERSION: u32 = 758; + with open('../azalea-protocol/src/packets/mod.rs', 'r') as f: + mod_rs = f.read().splitlines() + for line in mod_rs: + if line.strip().startswith('pub const PROTOCOL_VERSION'): + return line.strip().split(' ')[-1].strip(';') + raise Exception('Could not find protocol version in azalea-protocol/src/packets/mod.rs') + +def set_protocol_version(protocol_version: str) -> None: + with open('../azalea-protocol/src/packets/mod.rs', 'r') as f: + mod_rs = f.read().splitlines() + for i, line in enumerate(mod_rs): + if line.strip().startswith('pub const PROTOCOL_VERSION'): + mod_rs[i] = f'pub const PROTOCOL_VERSION: u32 = {protocol_version};' + break + else: + raise Exception('Could not find protocol version in azalea-protocol/src/packets/mod.rs') + + with open('../azalea-protocol/src/packets/mod.rs', 'w') as f: + f.write('\n'.join(mod_rs)) \ No newline at end of file From 1e145a82b80fb0402e8a64624454d9bfee77bc72 Mon Sep 17 00:00:00 2001 From: mat Date: Thu, 26 May 2022 13:45:48 -0500 Subject: [PATCH 19/27] 1.19 --- README.md | 2 +- azalea-client/src/connect.rs | 34 ++++-- azalea-crypto/src/lib.rs | 4 +- azalea-crypto/src/signing.rs | 5 + azalea-protocol/src/mc_buf/read.rs | 35 ++---- azalea-protocol/src/mc_buf/write.rs | 9 ++ .../game/clientbound_add_mob_packet.rs | 21 ---- .../clientbound_block_changed_ack_packet.rs | 7 ++ .../packets/game/clientbound_chat_packet.rs | 17 --- .../game/clientbound_chat_preview_packet.rs | 8 ++ .../game/clientbound_player_chat_packet.rs | 21 ++++ .../game/clientbound_server_data_packet.rs | 9 ++ ...entbound_set_chunk_cache_center_packet.rs} | 0 ...ntbound_set_display_chat_preview_packet.rs | 6 ++ .../game/clientbound_system_chat_packet.rs | 9 ++ azalea-protocol/src/packets/game/mod.rs | 102 ++++++++++-------- .../game/serverbound_chat_command_packet.rs | 18 ++++ .../game/serverbound_chat_preview_packet.rs | 7 ++ .../packets/login/serverbound_hello_packet.rs | 15 ++- azalea-protocol/src/packets/mod.rs | 2 +- bot/src/main.rs | 16 +-- codegen/migrate.py | 5 + 22 files changed, 222 insertions(+), 130 deletions(-) create mode 100644 azalea-crypto/src/signing.rs delete mode 100644 azalea-protocol/src/packets/game/clientbound_add_mob_packet.rs create mode 100644 azalea-protocol/src/packets/game/clientbound_block_changed_ack_packet.rs delete mode 100644 azalea-protocol/src/packets/game/clientbound_chat_packet.rs create mode 100644 azalea-protocol/src/packets/game/clientbound_chat_preview_packet.rs create mode 100644 azalea-protocol/src/packets/game/clientbound_player_chat_packet.rs create mode 100644 azalea-protocol/src/packets/game/clientbound_server_data_packet.rs rename azalea-protocol/src/packets/game/{clientbound_set_chunk_cache_center.rs => clientbound_set_chunk_cache_center_packet.rs} (100%) create mode 100644 azalea-protocol/src/packets/game/clientbound_set_display_chat_preview_packet.rs create mode 100644 azalea-protocol/src/packets/game/clientbound_system_chat_packet.rs create mode 100644 azalea-protocol/src/packets/game/serverbound_chat_command_packet.rs create mode 100644 azalea-protocol/src/packets/game/serverbound_chat_preview_packet.rs diff --git a/README.md b/README.md index d3ebdf51..2ce2f26e 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ A Rust crate for creating Minecraft bots.

-*Currently supported Minecraft version: `1.18.2`.* +*Currently supported Minecraft version: `1.19-pre3`.* I named this Azalea because it sounds like a cool word and this is a cool library. This project was heavily inspired by PrismarineJS. diff --git a/azalea-client/src/connect.rs b/azalea-client/src/connect.rs index b8b6e372..a0001804 100755 --- a/azalea-client/src/connect.rs +++ b/azalea-client/src/connect.rs @@ -4,7 +4,8 @@ use azalea_protocol::{ connect::{GameConnection, HandshakeConnection}, packets::{ game::{ - clientbound_chat_packet::ClientboundChatPacket, + clientbound_player_chat_packet::ClientboundPlayerChatPacket, + clientbound_system_chat_packet::ClientboundSystemChatPacket, serverbound_custom_payload_packet::ServerboundCustomPayloadPacket, serverbound_keep_alive_packet::ServerboundKeepAlivePacket, GamePacket, }, @@ -43,10 +44,25 @@ pub struct Client { // game_loop } +#[derive(Debug, Clone)] +pub enum ChatPacket { + System(ClientboundSystemChatPacket), + Player(ClientboundPlayerChatPacket), +} + +// impl ChatPacket { +// pub fn message(&self) -> &str { +// match self { +// ChatPacket::System(p) => &p.content, +// ChatPacket::Player(p) => &p.message, +// } +// } +// } + #[derive(Debug, Clone)] pub enum Event { Login, - Chat(ClientboundChatPacket), + Chat(ChatPacket), } /// Whether we should ignore errors when decoding packets. @@ -75,6 +91,7 @@ impl Client { conn.write( ServerboundHelloPacket { username: account.username.clone(), + public_key: None, } .get(), ) @@ -290,9 +307,6 @@ impl Client { GamePacket::ClientboundLightUpdatePacket(p) => { println!("Got light update packet {:?}", p); } - GamePacket::ClientboundAddMobPacket(p) => { - println!("Got add mob packet {:?}", p); - } GamePacket::ClientboundAddEntityPacket(p) => { println!("Got add entity packet {:?}", p); } @@ -357,9 +371,13 @@ impl Client { GamePacket::ClientboundRemoveEntitiesPacket(p) => { println!("Got remove entities packet {:?}", p); } - GamePacket::ClientboundChatPacket(p) => { - println!("Got chat packet {:?}", p); - tx.send(Event::Chat(p.clone())).unwrap(); + GamePacket::ClientboundPlayerChatPacket(p) => { + println!("Got player chat packet {:?}", p); + tx.send(Event::Chat(ChatPacket::Player(p.clone()))).unwrap(); + } + GamePacket::ClientboundSystemChatPacket(p) => { + println!("Got system chat packet {:?}", p); + tx.send(Event::Chat(ChatPacket::System(p.clone()))).unwrap(); } GamePacket::ClientboundSoundPacket(p) => { println!("Got sound packet {:?}", p); diff --git a/azalea-crypto/src/lib.rs b/azalea-crypto/src/lib.rs index c233b231..a5e797e8 100644 --- a/azalea-crypto/src/lib.rs +++ b/azalea-crypto/src/lib.rs @@ -1,3 +1,5 @@ +mod signing; + use aes::cipher::inout::InOutBuf; use aes::{ cipher::{BlockDecryptMut, BlockEncryptMut, KeyIvInit}, @@ -5,6 +7,7 @@ use aes::{ }; use rand::{rngs::OsRng, RngCore}; use sha1::{Digest, Sha1}; +pub use signing::SaltSignaturePair; fn generate_secret_key() -> [u8; 16] { let mut key = [0u8; 16]; @@ -65,7 +68,6 @@ pub fn create_cipher(key: &[u8]) -> (Aes128CfbEnc, Aes128CfbDec) { ) } -// wow this is terrible pub fn encrypt_packet(cipher: &mut Aes128CfbEnc, packet: &mut [u8]) { let (chunks, rest) = InOutBuf::from(packet).into_chunks(); assert!(rest.is_empty()); diff --git a/azalea-crypto/src/signing.rs b/azalea-crypto/src/signing.rs new file mode 100644 index 00000000..21cd813a --- /dev/null +++ b/azalea-crypto/src/signing.rs @@ -0,0 +1,5 @@ +#[derive(Debug, Clone)] +pub struct SaltSignaturePair { + pub salt: u64, + pub signature: Vec, +} diff --git a/azalea-protocol/src/mc_buf/read.rs b/azalea-protocol/src/mc_buf/read.rs index 1c4fbd6f..350c0998 100644 --- a/azalea-protocol/src/mc_buf/read.rs +++ b/azalea-protocol/src/mc_buf/read.rs @@ -4,6 +4,7 @@ use azalea_core::{ difficulty::Difficulty, game_type::GameType, resource_location::ResourceLocation, serializable_uuid::SerializableUuid, BlockPos, ChunkSectionPos, Direction, Slot, SlotData, }; +use azalea_crypto::SaltSignaturePair; use byteorder::{ReadBytesExt, BE}; use serde::Deserialize; use std::{collections::HashMap, hash::Hash, io::Read}; @@ -311,56 +312,48 @@ impl McBufReadable for Vec { } } -// string impl McBufReadable for String { fn read_into(buf: &mut impl Read) -> Result { buf.read_utf() } } -// ResourceLocation impl McBufReadable for ResourceLocation { fn read_into(buf: &mut impl Read) -> Result { buf.read_resource_location() } } -// u32 impl McBufReadable for u32 { fn read_into(buf: &mut impl Read) -> Result { Readable::read_int(buf).map(|i| i as u32) } } -// u32 varint impl McBufVarReadable for u32 { fn var_read_into(buf: &mut impl Read) -> Result { buf.read_varint().map(|i| i as u32) } } -// u16 impl McBufReadable for u16 { fn read_into(buf: &mut impl Read) -> Result { buf.read_short().map(|i| i as u16) } } -// i16 impl McBufReadable for i16 { fn read_into(buf: &mut impl Read) -> Result { buf.read_short() } } -// u16 varint impl McBufVarReadable for u16 { fn var_read_into(buf: &mut impl Read) -> Result { buf.read_varint().map(|i| i as u16) } } -// Vec varint impl McBufVarReadable for Vec { fn var_read_into(buf: &mut impl Read) -> Result { let length = buf.read_varint()? as usize; @@ -372,70 +365,60 @@ impl McBufVarReadable for Vec { } } -// i64 impl McBufReadable for i64 { fn read_into(buf: &mut impl Read) -> Result { buf.read_long() } } -// u64 impl McBufReadable for u64 { fn read_into(buf: &mut impl Read) -> Result { i64::read_into(buf).map(|i| i as u64) } } -// bool impl McBufReadable for bool { fn read_into(buf: &mut impl Read) -> Result { buf.read_boolean() } } -// u8 impl McBufReadable for u8 { fn read_into(buf: &mut impl Read) -> Result { buf.read_byte() } } -// i8 impl McBufReadable for i8 { fn read_into(buf: &mut impl Read) -> Result { buf.read_byte().map(|i| i as i8) } } -// f32 impl McBufReadable for f32 { fn read_into(buf: &mut impl Read) -> Result { buf.read_float() } } -// f64 impl McBufReadable for f64 { fn read_into(buf: &mut impl Read) -> Result { buf.read_double() } } -// GameType impl McBufReadable for GameType { fn read_into(buf: &mut impl Read) -> Result { GameType::from_id(buf.read_byte()?) } } -// Option impl McBufReadable for Option { fn read_into(buf: &mut impl Read) -> Result { GameType::from_optional_id(buf.read_byte()? as i8) } } -// Option impl McBufReadable for Option { default fn read_into(buf: &mut impl Read) -> Result { let present = buf.read_boolean()?; @@ -447,21 +430,18 @@ impl McBufReadable for Option { } } -// azalea_nbt::Tag impl McBufReadable for azalea_nbt::Tag { fn read_into(buf: &mut impl Read) -> Result { buf.read_nbt() } } -// Difficulty impl McBufReadable for Difficulty { fn read_into(buf: &mut impl Read) -> Result { Ok(Difficulty::by_id(u8::read_into(buf)?)) } } -// Component impl McBufReadable for Component { fn read_into(buf: &mut impl Read) -> Result { let string = buf.read_utf()?; @@ -472,7 +452,6 @@ impl McBufReadable for Component { } } -// Slot impl McBufReadable for Slot { fn read_into(buf: &mut impl Read) -> Result { let present = buf.read_boolean()?; @@ -486,14 +465,12 @@ impl McBufReadable for Slot { } } -// Uuid impl McBufReadable for Uuid { fn read_into(buf: &mut impl Read) -> Result { buf.read_uuid() } } -// BlockPos impl McBufReadable for BlockPos { fn read_into(buf: &mut impl Read) -> Result { let val = u64::read_into(buf)?; @@ -504,7 +481,6 @@ impl McBufReadable for BlockPos { } } -// Direction impl McBufReadable for Direction { fn read_into(buf: &mut impl Read) -> Result { match buf.read_varint()? { @@ -519,7 +495,6 @@ impl McBufReadable for Direction { } } -// ChunkSectionPos impl McBufReadable for ChunkSectionPos { fn read_into(buf: &mut impl Read) -> Result { let long = i64::read_into(buf)?; @@ -530,3 +505,11 @@ impl McBufReadable for ChunkSectionPos { }) } } + +impl McBufReadable for SaltSignaturePair { + fn read_into(buf: &mut impl Read) -> Result { + let salt = u64::read_into(buf)?; + let signature = Vec::::read_into(buf)?; + Ok(SaltSignaturePair { salt, signature }) + } +} diff --git a/azalea-protocol/src/mc_buf/write.rs b/azalea-protocol/src/mc_buf/write.rs index c46297a6..95c39bd2 100644 --- a/azalea-protocol/src/mc_buf/write.rs +++ b/azalea-protocol/src/mc_buf/write.rs @@ -4,6 +4,7 @@ use azalea_core::{ difficulty::Difficulty, game_type::GameType, resource_location::ResourceLocation, serializable_uuid::SerializableUuid, BlockPos, ChunkSectionPos, Direction, Slot, }; +use azalea_crypto::SaltSignaturePair; use byteorder::{BigEndian, WriteBytesExt}; use std::{collections::HashMap, io::Write}; use uuid::Uuid; @@ -436,3 +437,11 @@ impl McBufWritable for ChunkSectionPos { Ok(()) } } + +impl McBufWritable for SaltSignaturePair { + fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { + self.salt.write_into(buf)?; + self.signature.write_into(buf)?; + Ok(()) + } +} diff --git a/azalea-protocol/src/packets/game/clientbound_add_mob_packet.rs b/azalea-protocol/src/packets/game/clientbound_add_mob_packet.rs deleted file mode 100644 index bc0ddcef..00000000 --- a/azalea-protocol/src/packets/game/clientbound_add_mob_packet.rs +++ /dev/null @@ -1,21 +0,0 @@ -use packet_macros::{GamePacket, McBuf}; -use uuid::Uuid; - -#[derive(Clone, Debug, McBuf, GamePacket)] -pub struct ClientboundAddMobPacket { - #[var] - pub id: i32, - pub uuid: Uuid, - // TODO: have an entity type struct - #[var] - pub entity_type: i32, - pub x: f64, - pub y: f64, - pub z: f64, - pub x_rot: i8, - pub y_rot: i8, - pub y_head_rot: i8, - pub x_vel: u16, - pub y_vel: u16, - pub z_vel: u16, -} diff --git a/azalea-protocol/src/packets/game/clientbound_block_changed_ack_packet.rs b/azalea-protocol/src/packets/game/clientbound_block_changed_ack_packet.rs new file mode 100644 index 00000000..a580440c --- /dev/null +++ b/azalea-protocol/src/packets/game/clientbound_block_changed_ack_packet.rs @@ -0,0 +1,7 @@ +use packet_macros::{GamePacket, McBuf}; + +#[derive(Clone, Debug, McBuf, GamePacket)] +pub struct ClientboundBlockChangedAckPacket { + #[var] + pub sequence: i32, +} diff --git a/azalea-protocol/src/packets/game/clientbound_chat_packet.rs b/azalea-protocol/src/packets/game/clientbound_chat_packet.rs deleted file mode 100644 index 77c5370c..00000000 --- a/azalea-protocol/src/packets/game/clientbound_chat_packet.rs +++ /dev/null @@ -1,17 +0,0 @@ -use azalea_chat::component::Component; -use packet_macros::{GamePacket, McBuf}; -use uuid::Uuid; - -#[derive(Clone, Debug, McBuf, GamePacket)] -pub struct ClientboundChatPacket { - pub message: Component, - pub type_: ChatType, - pub sender: Uuid, -} - -#[derive(Clone, Debug, Copy, McBuf)] -pub enum ChatType { - Chat = 0, - System = 1, - GameInfo = 2, -} diff --git a/azalea-protocol/src/packets/game/clientbound_chat_preview_packet.rs b/azalea-protocol/src/packets/game/clientbound_chat_preview_packet.rs new file mode 100644 index 00000000..58dd0722 --- /dev/null +++ b/azalea-protocol/src/packets/game/clientbound_chat_preview_packet.rs @@ -0,0 +1,8 @@ +use azalea_chat::component::Component; +use packet_macros::{GamePacket, McBuf}; + +#[derive(Clone, Debug, McBuf, GamePacket)] +pub struct ClientboundChatPreviewPacket { + pub query_id: i32, + pub preview: Option, +} diff --git a/azalea-protocol/src/packets/game/clientbound_player_chat_packet.rs b/azalea-protocol/src/packets/game/clientbound_player_chat_packet.rs new file mode 100644 index 00000000..e6941f25 --- /dev/null +++ b/azalea-protocol/src/packets/game/clientbound_player_chat_packet.rs @@ -0,0 +1,21 @@ +use azalea_chat::component::Component; +use azalea_crypto::SaltSignaturePair; +use packet_macros::{GamePacket, McBuf}; + +#[derive(Clone, Debug, McBuf, GamePacket)] +pub struct ClientboundPlayerChatPacket { + pub signed_content: Component, + pub unsigned_content: Option, + #[var] + pub type_id: i32, + pub sender: ChatSender, + pub timestamp: u64, + pub salt_signature: SaltSignaturePair, +} + +#[derive(Clone, Debug, McBuf)] +pub struct ChatSender { + pub uuid: uuid::Uuid, + pub name: Component, + pub team_name: Option, +} diff --git a/azalea-protocol/src/packets/game/clientbound_server_data_packet.rs b/azalea-protocol/src/packets/game/clientbound_server_data_packet.rs new file mode 100644 index 00000000..4c2d94e6 --- /dev/null +++ b/azalea-protocol/src/packets/game/clientbound_server_data_packet.rs @@ -0,0 +1,9 @@ +use azalea_chat::component::Component; +use packet_macros::{GamePacket, McBuf}; + +#[derive(Clone, Debug, McBuf, GamePacket)] +pub struct ClientboundServerDataPacket { + pub motd: Option, + pub icon_base64: Option, + pub previews_chat: bool, +} diff --git a/azalea-protocol/src/packets/game/clientbound_set_chunk_cache_center.rs b/azalea-protocol/src/packets/game/clientbound_set_chunk_cache_center_packet.rs similarity index 100% rename from azalea-protocol/src/packets/game/clientbound_set_chunk_cache_center.rs rename to azalea-protocol/src/packets/game/clientbound_set_chunk_cache_center_packet.rs diff --git a/azalea-protocol/src/packets/game/clientbound_set_display_chat_preview_packet.rs b/azalea-protocol/src/packets/game/clientbound_set_display_chat_preview_packet.rs new file mode 100644 index 00000000..46a0d582 --- /dev/null +++ b/azalea-protocol/src/packets/game/clientbound_set_display_chat_preview_packet.rs @@ -0,0 +1,6 @@ +use packet_macros::{GamePacket, McBuf}; + +#[derive(Clone, Debug, McBuf, GamePacket)] +pub struct ClientboundSetDisplayChatPreviewPacket { + pub enabled: bool, +} diff --git a/azalea-protocol/src/packets/game/clientbound_system_chat_packet.rs b/azalea-protocol/src/packets/game/clientbound_system_chat_packet.rs new file mode 100644 index 00000000..dfa75a5b --- /dev/null +++ b/azalea-protocol/src/packets/game/clientbound_system_chat_packet.rs @@ -0,0 +1,9 @@ +use azalea_chat::component::Component; +use packet_macros::{GamePacket, McBuf}; + +#[derive(Clone, Debug, McBuf, GamePacket)] +pub struct ClientboundSystemChatPacket { + pub content: Component, + #[var] + pub type_id: i32, +} diff --git a/azalea-protocol/src/packets/game/mod.rs b/azalea-protocol/src/packets/game/mod.rs index 7372435a..eee36788 100755 --- a/azalea-protocol/src/packets/game/mod.rs +++ b/azalea-protocol/src/packets/game/mod.rs @@ -1,10 +1,10 @@ pub mod clientbound_add_entity_packet; -pub mod clientbound_add_mob_packet; pub mod clientbound_add_player_packet; pub mod clientbound_animate_packet; +pub mod clientbound_block_changed_ack_packet; pub mod clientbound_block_update_packet; pub mod clientbound_change_difficulty_packet; -pub mod clientbound_chat_packet; +pub mod clientbound_chat_preview_packet; pub mod clientbound_container_set_content_packet; pub mod clientbound_custom_payload_packet; pub mod clientbound_declare_commands_packet; @@ -23,27 +23,33 @@ pub mod clientbound_move_entity_pos_packet; pub mod clientbound_move_entity_posrot_packet; pub mod clientbound_move_entity_rot_packet; pub mod clientbound_player_abilities_packet; +pub mod clientbound_player_chat_packet; pub mod clientbound_player_info_packet; pub mod clientbound_player_position_packet; pub mod clientbound_recipe_packet; pub mod clientbound_remove_entities_packet; pub mod clientbound_rotate_head_packet; pub mod clientbound_section_blocks_update_packet; +pub mod clientbound_server_data_packet; pub mod clientbound_set_carried_item_packet; -pub mod clientbound_set_chunk_cache_center; +pub mod clientbound_set_chunk_cache_center_packet; pub mod clientbound_set_default_spawn_position_packet; +pub mod clientbound_set_display_chat_preview_packet; pub mod clientbound_set_entity_data_packet; pub mod clientbound_set_entity_link_packet; pub mod clientbound_set_experience_packet; pub mod clientbound_set_health_packet; pub mod clientbound_set_time_packet; pub mod clientbound_sound_packet; +pub mod clientbound_system_chat_packet; pub mod clientbound_teleport_entity_packet; pub mod clientbound_update_advancements_packet; pub mod clientbound_update_attributes_packet; pub mod clientbound_update_recipes_packet; pub mod clientbound_update_tags_packet; pub mod clientbound_update_view_distance_packet; +pub mod serverbound_chat_command_packet; +pub mod serverbound_chat_preview_packet; pub mod serverbound_custom_payload_packet; pub mod serverbound_keep_alive_packet; @@ -52,55 +58,61 @@ use packet_macros::declare_state_packets; declare_state_packets!( GamePacket, Serverbound => { - 0x0a: serverbound_custom_payload_packet::ServerboundCustomPayloadPacket, - 0x0f: serverbound_keep_alive_packet::ServerboundKeepAlivePacket, + 0x03: serverbound_chat_command_packet::ServerboundChatCommandPacket, + 0x05: serverbound_chat_preview_packet::ServerboundChatPreviewPacket, + 0x0c: serverbound_custom_payload_packet::ServerboundCustomPayloadPacket, + 0x11: serverbound_keep_alive_packet::ServerboundKeepAlivePacket, }, Clientbound => { 0x00: clientbound_add_entity_packet::ClientboundAddEntityPacket, - 0x02: clientbound_add_mob_packet::ClientboundAddMobPacket, - 0x04: clientbound_add_player_packet::ClientboundAddPlayerPacket, - 0x06: clientbound_animate_packet::ClientboundAnimatePacket, - 0x0c: clientbound_block_update_packet::ClientboundBlockUpdatePacket, - 0x0e: clientbound_change_difficulty_packet::ClientboundChangeDifficultyPacket, - 0x0f: clientbound_chat_packet::ClientboundChatPacket, - 0x12: clientbound_declare_commands_packet::ClientboundDeclareCommandsPacket, - 0x14: clientbound_container_set_content_packet::ClientboundContainerSetContentPacket, - 0x1a: clientbound_disconnect_packet::ClientboundDisconnectPacket, - 0x1b: clientbound_entity_event_packet::ClientboundEntityEventPacket, - 0x18: clientbound_custom_payload_packet::ClientboundCustomPayloadPacket, - 0x1e: clientbound_game_event_packet::ClientboundGameEventPacket, - 0x20: clientbound_initialize_border_packet::ClientboundInitializeBorderPacket, - 0x21: clientbound_keep_alive_packet::ClientboundKeepAlivePacket, - 0x22: clientbound_level_chunk_with_light_packet::ClientboundLevelChunkWithLightPacket, - 0x23: clientbound_level_event_packet::ClientboundLevelEventPacket, - 0x24: clientbound_level_particles_packet::ClientboundLevelParticlesPacket, - 0x25: clientbound_light_update_packet::ClientboundLightUpdatePacket, - 0x26: clientbound_login_packet::ClientboundLoginPacket, - 0x29: clientbound_move_entity_pos_packet::ClientboundMoveEntityPosPacket, - 0x2a: clientbound_move_entity_posrot_packet::ClientboundMoveEntityPosRotPacket, - 0x2b: clientbound_move_entity_rot_packet::ClientboundMoveEntityRotPacket, - 0x32: clientbound_player_abilities_packet::ClientboundPlayerAbilitiesPacket, - 0x36: clientbound_player_info_packet::ClientboundPlayerInfoPacket, - 0x38: clientbound_player_position_packet::ClientboundPlayerPositionPacket, - 0x39: clientbound_recipe_packet::ClientboundRecipePacket, - 0x3a: clientbound_remove_entities_packet::ClientboundRemoveEntitiesPacket, - 0x3e: clientbound_rotate_head_packet::ClientboundRotateHeadPacket, - 0x3f: clientbound_section_blocks_update_packet::ClientboundSectionBlocksUpdatePacket, - 0x48: clientbound_set_carried_item_packet::ClientboundSetCarriedItemPacket, - 0x49: clientbound_set_chunk_cache_center::ClientboundSetChunkCacheCenterPacket, - 0x4a: clientbound_update_view_distance_packet::ClientboundUpdateViewDistancePacket, - 0x4b: clientbound_set_default_spawn_position_packet::ClientboundSetDefaultSpawnPositionPacket, + 0x02: clientbound_add_player_packet::ClientboundAddPlayerPacket, + 0x03: clientbound_animate_packet::ClientboundAnimatePacket, + 0x05: clientbound_block_changed_ack_packet::ClientboundBlockChangedAckPacket, + 0x09: clientbound_block_update_packet::ClientboundBlockUpdatePacket, + 0x0b: clientbound_change_difficulty_packet::ClientboundChangeDifficultyPacket, + 0x0c: clientbound_chat_preview_packet::ClientboundChatPreviewPacket, + 0x0f: clientbound_declare_commands_packet::ClientboundDeclareCommandsPacket, + 0x11: clientbound_container_set_content_packet::ClientboundContainerSetContentPacket, + 0x15: clientbound_custom_payload_packet::ClientboundCustomPayloadPacket, + 0x17: clientbound_disconnect_packet::ClientboundDisconnectPacket, + 0x18: clientbound_entity_event_packet::ClientboundEntityEventPacket, + 0x1b: clientbound_game_event_packet::ClientboundGameEventPacket, + 0x1d: clientbound_initialize_border_packet::ClientboundInitializeBorderPacket, + 0x1e: clientbound_keep_alive_packet::ClientboundKeepAlivePacket, + 0x1f: clientbound_level_chunk_with_light_packet::ClientboundLevelChunkWithLightPacket, + 0x20: clientbound_level_event_packet::ClientboundLevelEventPacket, + 0x21: clientbound_level_particles_packet::ClientboundLevelParticlesPacket, + 0x22: clientbound_light_update_packet::ClientboundLightUpdatePacket, + 0x23: clientbound_login_packet::ClientboundLoginPacket, + 0x26: clientbound_move_entity_pos_packet::ClientboundMoveEntityPosPacket, + 0x27: clientbound_move_entity_posrot_packet::ClientboundMoveEntityPosRotPacket, + 0x28: clientbound_move_entity_rot_packet::ClientboundMoveEntityRotPacket, + 0x2f: clientbound_player_abilities_packet::ClientboundPlayerAbilitiesPacket, + 0x30: clientbound_player_chat_packet::ClientboundPlayerChatPacket, + 0x34: clientbound_player_info_packet::ClientboundPlayerInfoPacket, + 0x36: clientbound_player_position_packet::ClientboundPlayerPositionPacket, + 0x37: clientbound_recipe_packet::ClientboundRecipePacket, + 0x38: clientbound_remove_entities_packet::ClientboundRemoveEntitiesPacket, + 0x3c: clientbound_rotate_head_packet::ClientboundRotateHeadPacket, + 0x3d: clientbound_section_blocks_update_packet::ClientboundSectionBlocksUpdatePacket, + 0x3f: clientbound_server_data_packet::ClientboundServerDataPacket, + 0x44: clientbound_set_entity_link_packet::ClientboundSetEntityLinkPacket, + 0x47: clientbound_set_carried_item_packet::ClientboundSetCarriedItemPacket, + 0x48: clientbound_set_chunk_cache_center_packet::ClientboundSetChunkCacheCenterPacket, + 0x49: clientbound_update_view_distance_packet::ClientboundUpdateViewDistancePacket, + 0x4a: clientbound_set_default_spawn_position_packet::ClientboundSetDefaultSpawnPositionPacket, + 0x4b: clientbound_set_display_chat_preview_packet::ClientboundSetDisplayChatPreviewPacket, 0x4d: clientbound_set_entity_data_packet::ClientboundSetEntityDataPacket, - 0x45: clientbound_set_entity_link_packet::ClientboundSetEntityLinkPacket, 0x4f: clientbound_entity_velocity_packet::ClientboundEntityVelocityPacket, 0x51: clientbound_set_experience_packet::ClientboundSetExperiencePacket, 0x52: clientbound_set_health_packet::ClientboundSetHealthPacket, 0x59: clientbound_set_time_packet::ClientboundSetTimePacket, 0x5d: clientbound_sound_packet::ClientboundSoundPacket, - 0x62: clientbound_teleport_entity_packet::ClientboundTeleportEntityPacket, - 0x63: clientbound_update_advancements_packet::ClientboundUpdateAdvancementsPacket, - 0x64: clientbound_update_attributes_packet::ClientboundUpdateAttributesPacket, - 0x66: clientbound_update_recipes_packet::ClientboundUpdateRecipesPacket, - 0x67: clientbound_update_tags_packet::ClientboundUpdateTagsPacket, + 0x5f: clientbound_system_chat_packet::ClientboundSystemChatPacket, + 0x63: clientbound_teleport_entity_packet::ClientboundTeleportEntityPacket, + 0x64: clientbound_update_advancements_packet::ClientboundUpdateAdvancementsPacket, + 0x65: clientbound_update_attributes_packet::ClientboundUpdateAttributesPacket, + 0x67: clientbound_update_recipes_packet::ClientboundUpdateRecipesPacket, + 0x68: clientbound_update_tags_packet::ClientboundUpdateTagsPacket, } -); \ No newline at end of file +); diff --git a/azalea-protocol/src/packets/game/serverbound_chat_command_packet.rs b/azalea-protocol/src/packets/game/serverbound_chat_command_packet.rs new file mode 100644 index 00000000..9ae0b79f --- /dev/null +++ b/azalea-protocol/src/packets/game/serverbound_chat_command_packet.rs @@ -0,0 +1,18 @@ +use std::collections::HashMap; + +use packet_macros::{GamePacket, McBuf}; + +#[derive(Clone, Debug, McBuf, GamePacket)] +pub struct ServerboundChatCommandPacket { + pub command: String, + // TODO: Choose a real timestamp type + pub timestamp: u64, + pub argument_signatures: ArgumentSignatures, + pub signed_preview: bool, +} + +#[derive(Clone, Debug, McBuf)] +pub struct ArgumentSignatures { + pub salt: u64, + pub signatures: HashMap>, +} diff --git a/azalea-protocol/src/packets/game/serverbound_chat_preview_packet.rs b/azalea-protocol/src/packets/game/serverbound_chat_preview_packet.rs new file mode 100644 index 00000000..60535f69 --- /dev/null +++ b/azalea-protocol/src/packets/game/serverbound_chat_preview_packet.rs @@ -0,0 +1,7 @@ +use packet_macros::{GamePacket, McBuf}; + +#[derive(Clone, Debug, McBuf, GamePacket)] +pub struct ServerboundChatPreviewPacket { + pub query_id: i32, + pub query: String, +} diff --git a/azalea-protocol/src/packets/login/serverbound_hello_packet.rs b/azalea-protocol/src/packets/login/serverbound_hello_packet.rs index 5cb660ed..46fb665e 100755 --- a/azalea-protocol/src/packets/login/serverbound_hello_packet.rs +++ b/azalea-protocol/src/packets/login/serverbound_hello_packet.rs @@ -1,7 +1,18 @@ use packet_macros::{LoginPacket, McBuf}; -use std::hash::Hash; -#[derive(Hash, Clone, Debug, McBuf, LoginPacket)] +#[derive(Clone, Debug, McBuf, LoginPacket)] pub struct ServerboundHelloPacket { pub username: String, + pub public_key: Option, +} + +pub struct ProfilePublicKey { + pub data: ProfilePublicKeyData, +} + +#[derive(Clone, Debug, McBuf)] +pub struct ProfilePublicKeyData { + pub expires_at: u64, + pub key: Vec, + pub key_signature: Vec, } diff --git a/azalea-protocol/src/packets/mod.rs b/azalea-protocol/src/packets/mod.rs index 16e97068..a06dc940 100755 --- a/azalea-protocol/src/packets/mod.rs +++ b/azalea-protocol/src/packets/mod.rs @@ -12,7 +12,7 @@ use crate::{ use num_derive::FromPrimitive; use num_traits::FromPrimitive; -pub const PROTOCOL_VERSION: u32 = 758; +pub const PROTOCOL_VERSION: u32 = 1073741911; #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, FromPrimitive)] pub enum ConnectionProtocol { diff --git a/bot/src/main.rs b/bot/src/main.rs index 76a5a15d..8ad74ec4 100644 --- a/bot/src/main.rs +++ b/bot/src/main.rs @@ -6,7 +6,7 @@ async fn main() { println!("Hello, world!"); // let address = "95.111.249.143:10000"; - let address = "192.168.2.234:50736"; + let address = "localhost:65519"; // let response = azalea_client::ping::ping_server(&address.try_into().unwrap()) // .await // .unwrap(); @@ -21,13 +21,13 @@ async fn main() { // TODO: have a "loaded" or "ready" event that fires when all chunks are loaded Event::Login => {} Event::Chat(p) => { - println!("{}", p.message.to_ansi(None)); - if p.message.to_ansi(None) == " ok" { - let state = client.state.lock().await; - let world = state.world.as_ref().unwrap(); - let c = world.get_block_state(&BlockPos::new(5, 78, -2)).unwrap(); - println!("block state: {:?}", c); - } + // println!("{}", p.message.to_ansi(None)); + // if p.message.to_ansi(None) == " ok" { + // let state = client.state.lock().await; + // let world = state.world.as_ref().unwrap(); + // let c = world.get_block_state(&BlockPos::new(5, 78, -2)).unwrap(); + // println!("block state: {:?}", c); + // } } } } diff --git a/codegen/migrate.py b/codegen/migrate.py index 392af9fe..98b701bf 100644 --- a/codegen/migrate.py +++ b/codegen/migrate.py @@ -72,6 +72,11 @@ for packet, packet_name in new_packets.items(): for packet in added_packets: lib.code.packet.generate_packet( new_burger_data[0]['packets']['packet'], new_mappings, packet.packet_id, packet.direction, packet.state) + +lib.code.version.set_protocol_version( + new_burger_data[0]['version']['protocol']) +lib.code.version.set_version_id(new_version_id) + lib.code.utils.fmt() print('Done!') From 0530c5757925c615d0529926b1550da05f0669d9 Mon Sep 17 00:00:00 2001 From: mat Date: Thu, 26 May 2022 17:55:07 -0500 Subject: [PATCH 20/27] Fixes --- azalea-client/src/connect.rs | 60 +- azalea-core/src/lib.rs | 4 +- azalea-core/src/position.rs | 10 + azalea-nbt/README.md | 2 + azalea-nbt/src/error.rs | 14 +- azalea-protocol/packet-macros/src/lib.rs | 26 +- azalea-protocol/src/lib.rs | 1 + azalea-protocol/src/mc_buf/read.rs | 12 +- azalea-protocol/src/mc_buf/write.rs | 37 +- .../clientbound_declare_commands_packet.rs | 236 +- .../packets/game/clientbound_login_packet.rs | 5 +- .../packets/login/clientbound_hello_packet.rs | 36 +- .../packets/login/serverbound_key_packet.rs | 49 +- login.txt | 4812 +++++++++++++++++ 14 files changed, 5108 insertions(+), 196 deletions(-) create mode 100644 login.txt diff --git a/azalea-client/src/connect.rs b/azalea-client/src/connect.rs index a0001804..e63c9b07 100755 --- a/azalea-client/src/connect.rs +++ b/azalea-client/src/connect.rs @@ -12,7 +12,8 @@ use azalea_protocol::{ handshake::client_intention_packet::ClientIntentionPacket, login::{ serverbound_hello_packet::ServerboundHelloPacket, - serverbound_key_packet::ServerboundKeyPacket, LoginPacket, + serverbound_key_packet::{NonceOrSaltSignature, ServerboundKeyPacket}, + LoginPacket, }, ConnectionProtocol, PROTOCOL_VERSION, }, @@ -109,8 +110,10 @@ impl Client { conn.write( ServerboundKeyPacket { - nonce: e.encrypted_nonce, - shared_secret: e.encrypted_public_key, + nonce_or_salt_signature: NonceOrSaltSignature::Nonce( + e.encrypted_nonce, + ), + key_bytes: e.encrypted_public_key, } .get(), ) @@ -196,27 +199,66 @@ impl Client { println!("Got login packet {:?}", p); let mut state = state.lock().await; + + // write p into login.txt + std::io::Write::write_all( + &mut std::fs::File::create("login.txt").unwrap(), + format!("{:#?}", p).as_bytes(), + ) + .unwrap(); + state.player.entity.id = p.player_id; - let dimension_type = p - .dimension_type + + // TODO: have registry_holder be a struct because this sucks rn + // best way would be to add serde support to azalea-nbt + + let registry_holder = p + .registry_holder .as_compound() - .expect("Dimension type is not compound") + .expect("Registry holder is not a compound") .get("") .expect("No \"\" tag") .as_compound() - .expect("\"\" tag is not compound"); + .expect("\"\" tag is not a compound"); + let dimension_types = registry_holder + .get("minecraft:dimension_type") + .expect("No dimension_type tag") + .as_compound() + .expect("dimension_type is not a compound") + .get("value") + .expect("No dimension_type value") + .as_list() + .expect("dimension_type value is not a list"); + let dimension_type = dimension_types + .iter() + .find(|t| { + t.as_compound() + .expect("dimension_type value is not a compound") + .get("name") + .expect("No name tag") + .as_string() + .expect("name is not a string") + == p.dimension_type.to_string() + }) + .expect(&format!("No dimension_type with name {}", p.dimension_type)) + .as_compound() + .unwrap() + .get("element") + .expect("No element tag") + .as_compound() + .expect("element is not a compound"); let height = (*dimension_type .get("height") .expect("No height tag") .as_int() - .expect("height tag is not int")) + .expect("height tag is not an int")) .try_into() .expect("height is not a u32"); let min_y = (*dimension_type .get("min_y") .expect("No min_y tag") .as_int() - .expect("min_y tag is not int")) + .expect("min_y tag is not an int")) .try_into() .expect("min_y is not an i32"); diff --git a/azalea-core/src/lib.rs b/azalea-core/src/lib.rs index d2a2d558..cdb32ea9 100755 --- a/azalea-core/src/lib.rs +++ b/azalea-core/src/lib.rs @@ -11,7 +11,9 @@ mod slot; pub use slot::{Slot, SlotData}; mod position; -pub use position::{BlockPos, ChunkBlockPos, ChunkPos, ChunkSectionBlockPos, ChunkSectionPos}; +pub use position::{ + BlockPos, ChunkBlockPos, ChunkPos, ChunkSectionBlockPos, ChunkSectionPos, GlobalPos, +}; mod direction; pub use direction::Direction; diff --git a/azalea-core/src/position.rs b/azalea-core/src/position.rs index 9c7cd132..d5c97eab 100644 --- a/azalea-core/src/position.rs +++ b/azalea-core/src/position.rs @@ -1,5 +1,7 @@ use std::ops::Rem; +use crate::resource_location::ResourceLocation; + #[derive(Clone, Copy, Debug, Default)] pub struct BlockPos { pub x: i32, @@ -137,6 +139,14 @@ impl From<&ChunkBlockPos> for ChunkSectionBlockPos { } } +/// A block pos with an attached dimension +#[derive(Debug, Clone)] +pub struct GlobalPos { + pub pos: BlockPos, + // this is actually a ResourceKey in Minecraft, but i don't think it matters? + pub dimension: ResourceLocation, +} + #[cfg(test)] mod tests { use super::*; diff --git a/azalea-nbt/README.md b/azalea-nbt/README.md index 19498cf3..4d5cecc4 100755 --- a/azalea-nbt/README.md +++ b/azalea-nbt/README.md @@ -1,3 +1,5 @@ # Azalea NBT A fast NBT serializer and deserializer. + +TODO: serde support for fast registry_holder parsing in azalea-client diff --git a/azalea-nbt/src/error.rs b/azalea-nbt/src/error.rs index 219921e4..ef4a9e9f 100755 --- a/azalea-nbt/src/error.rs +++ b/azalea-nbt/src/error.rs @@ -2,7 +2,8 @@ pub enum Error { InvalidTagType(u8), InvalidTag, - WriteError, + WriteError(std::io::Error), + Utf8Error(std::string::FromUtf8Error), } impl std::fmt::Display for Error { @@ -10,18 +11,19 @@ impl std::fmt::Display for Error { match self { Error::InvalidTagType(id) => write!(f, "Invalid tag type: {}", id), Error::InvalidTag => write!(f, "Invalid tag"), - Error::WriteError => write!(f, "Write error"), + Error::WriteError(e) => write!(f, "Write error: {}", e), + Error::Utf8Error(e) => write!(f, "Utf8 error: {}", e), } } } impl From for Error { - fn from(_: std::io::Error) -> Self { - Error::WriteError + fn from(e: std::io::Error) -> Self { + Error::WriteError(e) } } impl From for Error { - fn from(_: std::string::FromUtf8Error) -> Self { - Error::WriteError + fn from(e: std::string::FromUtf8Error) -> Self { + Error::Utf8Error(e) } } diff --git a/azalea-protocol/packet-macros/src/lib.rs b/azalea-protocol/packet-macros/src/lib.rs index f3fe4e40..ae0fea0c 100755 --- a/azalea-protocol/packet-macros/src/lib.rs +++ b/azalea-protocol/packet-macros/src/lib.rs @@ -56,13 +56,23 @@ fn create_impl_mcbufreadable(ident: &Ident, data: &Data) -> proc_macro2::TokenSt } syn::Data::Enum(syn::DataEnum { variants, .. }) => { let mut match_contents = quote!(); + let mut variant_discrim: usize = 0; for variant in variants { let variant_name = &variant.ident; - let variant_discrim = &variant - .discriminant - .as_ref() - .expect("enum variant must have a discriminant") - .1; + match &variant.discriminant.as_ref() { + Some(d) => { + variant_discrim = match &d.1 { + syn::Expr::Lit(e) => match &e.lit { + syn::Lit::Int(i) => i.base10_parse().unwrap(), + _ => panic!("Error parsing enum discriminant"), + }, + _ => panic!("Error parsing enum discriminant"), + } + } + None => { + variant_discrim += 1; + } + } match_contents.extend(quote! { #variant_discrim => Ok(Self::#variant_name), }); @@ -344,6 +354,7 @@ pub fn declare_state_packets(input: TokenStream) -> TokenStream { }); } for PacketIdPair { id, module, name } in input.clientbound.packets { + let name_litstr = syn::LitStr::new(&name.to_string(), name.span()); enum_contents.extend(quote! { #name(#module::#name), }); @@ -354,7 +365,10 @@ pub fn declare_state_packets(input: TokenStream) -> TokenStream { #state_name::#name(packet) => packet.write(buf), }); clientbound_read_match_contents.extend(quote! { - #id => #module::#name::read(buf)?, + #id => { + println!("reading packet {}", #name_litstr); + #module::#name::read(buf)? + }, }); } diff --git a/azalea-protocol/src/lib.rs b/azalea-protocol/src/lib.rs index 3573894c..d7f75f00 100755 --- a/azalea-protocol/src/lib.rs +++ b/azalea-protocol/src/lib.rs @@ -1,6 +1,7 @@ //! This lib is responsible for parsing Minecraft packets. #![feature(min_specialization)] +#![feature(arbitrary_enum_discriminant)] use std::net::IpAddr; use std::str::FromStr; diff --git a/azalea-protocol/src/mc_buf/read.rs b/azalea-protocol/src/mc_buf/read.rs index 350c0998..7cb0bb09 100644 --- a/azalea-protocol/src/mc_buf/read.rs +++ b/azalea-protocol/src/mc_buf/read.rs @@ -2,7 +2,8 @@ use super::{UnsizedByteArray, MAX_STRING_LENGTH}; use azalea_chat::component::Component; use azalea_core::{ difficulty::Difficulty, game_type::GameType, resource_location::ResourceLocation, - serializable_uuid::SerializableUuid, BlockPos, ChunkSectionPos, Direction, Slot, SlotData, + serializable_uuid::SerializableUuid, BlockPos, ChunkSectionPos, Direction, GlobalPos, Slot, + SlotData, }; use azalea_crypto::SaltSignaturePair; use byteorder::{ReadBytesExt, BE}; @@ -481,6 +482,15 @@ impl McBufReadable for BlockPos { } } +impl McBufReadable for GlobalPos { + fn read_into(buf: &mut impl Read) -> Result { + Ok(GlobalPos { + pos: BlockPos::read_into(buf)?, + dimension: ResourceLocation::read_into(buf)?, + }) + } +} + impl McBufReadable for Direction { fn read_into(buf: &mut impl Read) -> Result { match buf.read_varint()? { diff --git a/azalea-protocol/src/mc_buf/write.rs b/azalea-protocol/src/mc_buf/write.rs index 95c39bd2..80ffaecd 100644 --- a/azalea-protocol/src/mc_buf/write.rs +++ b/azalea-protocol/src/mc_buf/write.rs @@ -2,7 +2,7 @@ use super::{UnsizedByteArray, MAX_STRING_LENGTH}; use azalea_chat::component::Component; use azalea_core::{ difficulty::Difficulty, game_type::GameType, resource_location::ResourceLocation, - serializable_uuid::SerializableUuid, BlockPos, ChunkSectionPos, Direction, Slot, + serializable_uuid::SerializableUuid, BlockPos, ChunkSectionPos, Direction, GlobalPos, Slot, }; use azalea_crypto::SaltSignaturePair; use byteorder::{BigEndian, WriteBytesExt}; @@ -193,28 +193,24 @@ impl McBufWritable for Vec { } } -// string impl McBufWritable for String { fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { buf.write_utf(self) } } -// ResourceLocation impl McBufWritable for ResourceLocation { fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { buf.write_resource_location(self) } } -// u32 impl McBufWritable for u32 { fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { i16::write_into(&(*self as i16), buf) } } -// u32 varint impl McBufVarWritable for u32 { fn var_write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { i32::var_write_into(&(*self as i32), buf) @@ -244,21 +240,18 @@ impl McBufVarWritable for u64 { } } -// u16 impl McBufWritable for u16 { fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { i16::write_into(&(*self as i16), buf) } } -// u16 varint impl McBufVarWritable for u16 { fn var_write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { i32::var_write_into(&(*self as i32), buf) } } -// Vec varint impl McBufVarWritable for Vec { fn var_write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { u32::var_write_into(&(self.len() as u32), buf)?; @@ -269,77 +262,66 @@ impl McBufVarWritable for Vec { } } -// u8 impl McBufWritable for u8 { fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { buf.write_byte(*self) } } -// i16 impl McBufWritable for i16 { fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { Writable::write_short(buf, *self) } } -// i64 impl McBufWritable for i64 { fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { Writable::write_long(buf, *self) } } -// u64 impl McBufWritable for u64 { fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { i64::write_into(&(*self as i64), buf) } } -// bool impl McBufWritable for bool { fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { buf.write_boolean(*self) } } -// i8 impl McBufWritable for i8 { fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { buf.write_byte(*self as u8) } } -// f32 impl McBufWritable for f32 { fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { buf.write_float(*self) } } -// f64 impl McBufWritable for f64 { fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { buf.write_double(*self) } } -// GameType impl McBufWritable for GameType { fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { u8::write_into(&self.to_id(), buf) } } -// Option impl McBufWritable for Option { fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { buf.write_byte(GameType::to_optional_id(self) as u8) } } -// Option impl McBufWritable for Option { default fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { if let Some(s) = self { @@ -352,21 +334,18 @@ impl McBufWritable for Option { } } -// azalea_nbt::Tag impl McBufWritable for azalea_nbt::Tag { fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { buf.write_nbt(self) } } -// Difficulty impl McBufWritable for Difficulty { fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { u8::write_into(&self.id(), buf) } } -// Component impl McBufWritable for Component { // async fn read_into(buf: &mut impl Read) -> Result // where @@ -384,7 +363,6 @@ impl McBufWritable for Component { } } -// Slot impl McBufWritable for Slot { fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { match self { @@ -400,7 +378,6 @@ impl McBufWritable for Slot { } } -// Slot impl McBufWritable for Uuid { fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { buf.write_uuid(self)?; @@ -409,7 +386,6 @@ impl McBufWritable for Uuid { } } -// BlockPos impl McBufWritable for BlockPos { fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { buf.write_long( @@ -420,14 +396,21 @@ impl McBufWritable for BlockPos { } } -// Direction +impl McBufWritable for GlobalPos { + fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { + BlockPos::write_into(&self.pos, buf)?; + ResourceLocation::write_into(&self.dimension, buf)?; + + Ok(()) + } +} + impl McBufWritable for Direction { fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { buf.write_varint(*self as i32) } } -// ChunkSectionPos impl McBufWritable for ChunkSectionPos { fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { let long = (((self.x & 0x3FFFFF) as i64) << 42) diff --git a/azalea-protocol/src/packets/game/clientbound_declare_commands_packet.rs b/azalea-protocol/src/packets/game/clientbound_declare_commands_packet.rs index 6743c3af..01f633f4 100755 --- a/azalea-protocol/src/packets/game/clientbound_declare_commands_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_declare_commands_packet.rs @@ -1,6 +1,7 @@ use super::GamePacket; use crate::mc_buf::{McBufReadable, McBufWritable, Readable, Writable}; use azalea_core::resource_location::ResourceLocation; +use packet_macros::McBuf; use std::{ hash::Hash, io::{Read, Write}, @@ -110,6 +111,58 @@ impl McBufWritable for BrigadierString { } } +#[derive(Debug, Clone, McBuf)] +pub enum BrigadierParserType { + Bool = 0, + Double, + Float, + Integer, + Long, + String, + Entity, + GameProfile, + BlockPos, + ColumnPos, + Vec3, + Vec2, + BlockState, + BlockPredicate, + ItemStack, + ItemPredicate, + Color, + Component, + Message, + Nbt, + NbtPath, + Objective, + ObjectiveCriteira, + Operation, + Particle, + Rotation, + Angle, + ScoreboardSlot, + ScoreHolder, + Swizzle, + Team, + ItemSlot, + ResourceLocation, + MobEffect, + Function, + EntityAnchor, + Range, + IntRange, + FloatRange, + ItemEnchantment, + EntitySummon, + Dimension, + Uuid, + NbtTag, + NbtCompoundTag, + Time, + ResourceOrTag, + Resource, +} + #[derive(Debug, Clone)] pub enum BrigadierParser { Bool, @@ -164,119 +217,84 @@ pub enum BrigadierParser { impl McBufReadable for BrigadierParser { fn read_into(buf: &mut impl Read) -> Result { - let parser = buf.read_resource_location()?; + let parser_type = BrigadierParserType::read_into(buf)?; - if parser == ResourceLocation::new("brigadier:bool")? { - Ok(BrigadierParser::Bool) - } else if parser == ResourceLocation::new("brigadier:double")? { - Ok(BrigadierParser::Double(BrigadierNumber::read_into(buf)?)) - } else if parser == ResourceLocation::new("brigadier:float")? { - Ok(BrigadierParser::Float(BrigadierNumber::read_into(buf)?)) - } else if parser == ResourceLocation::new("brigadier:integer")? { - Ok(BrigadierParser::Integer(BrigadierNumber::read_into(buf)?)) - } else if parser == ResourceLocation::new("brigadier:long")? { - Ok(BrigadierParser::Long(BrigadierNumber::read_into(buf)?)) - } else if parser == ResourceLocation::new("brigadier:string")? { - Ok(BrigadierParser::String(BrigadierString::read_into(buf)?)) - } else if parser == ResourceLocation::new("minecraft:entity")? { - let flags = buf.read_byte()?; - Ok(BrigadierParser::Entity { - single: flags & 0x01 != 0, - players_only: flags & 0x02 != 0, - }) - } else if parser == ResourceLocation::new("minecraft:game_profile")? { - Ok(BrigadierParser::GameProfile) - } else if parser == ResourceLocation::new("minecraft:block_pos")? { - Ok(BrigadierParser::BlockPos) - } else if parser == ResourceLocation::new("minecraft:column_pos")? { - Ok(BrigadierParser::ColumnPos) - } else if parser == ResourceLocation::new("minecraft:vec3")? { - Ok(BrigadierParser::Vec3) - } else if parser == ResourceLocation::new("minecraft:vec2")? { - Ok(BrigadierParser::Vec2) - } else if parser == ResourceLocation::new("minecraft:block_state")? { - Ok(BrigadierParser::BlockState) - } else if parser == ResourceLocation::new("minecraft:block_predicate")? { - Ok(BrigadierParser::BlockPredicate) - } else if parser == ResourceLocation::new("minecraft:item_stack")? { - Ok(BrigadierParser::ItemStack) - } else if parser == ResourceLocation::new("minecraft:item_predicate")? { - Ok(BrigadierParser::ItemPredicate) - } else if parser == ResourceLocation::new("minecraft:color")? { - Ok(BrigadierParser::Color) - } else if parser == ResourceLocation::new("minecraft:component")? { - Ok(BrigadierParser::Component) - } else if parser == ResourceLocation::new("minecraft:message")? { - Ok(BrigadierParser::Message) - } else if parser == ResourceLocation::new("minecraft:nbt")? { - Ok(BrigadierParser::Nbt) - } else if parser == ResourceLocation::new("minecraft:nbt_path")? { - Ok(BrigadierParser::NbtPath) - } else if parser == ResourceLocation::new("minecraft:objective")? { - Ok(BrigadierParser::Objective) - } else if parser == ResourceLocation::new("minecraft:objective_criteria")? { - Ok(BrigadierParser::ObjectiveCriteira) - } else if parser == ResourceLocation::new("minecraft:operation")? { - Ok(BrigadierParser::Operation) - } else if parser == ResourceLocation::new("minecraft:particle")? { - Ok(BrigadierParser::Particle) - } else if parser == ResourceLocation::new("minecraft:rotation")? { - Ok(BrigadierParser::Rotation) - } else if parser == ResourceLocation::new("minecraft:angle")? { - Ok(BrigadierParser::Angle) - } else if parser == ResourceLocation::new("minecraft:scoreboard_slot")? { - Ok(BrigadierParser::ScoreboardSlot) - } else if parser == ResourceLocation::new("minecraft:score_holder")? { - let flags = buf.read_byte()?; - Ok(BrigadierParser::ScoreHolder { - allows_multiple: flags & 0x01 != 0, - }) - } else if parser == ResourceLocation::new("minecraft:swizzle")? { - Ok(BrigadierParser::Swizzle) - } else if parser == ResourceLocation::new("minecraft:team")? { - Ok(BrigadierParser::Team) - } else if parser == ResourceLocation::new("minecraft:item_slot")? { - Ok(BrigadierParser::ItemSlot) - } else if parser == ResourceLocation::new("minecraft:resource_location")? { - Ok(BrigadierParser::ResourceLocation) - } else if parser == ResourceLocation::new("minecraft:mob_effect")? { - Ok(BrigadierParser::MobEffect) - } else if parser == ResourceLocation::new("minecraft:function")? { - Ok(BrigadierParser::Function) - } else if parser == ResourceLocation::new("minecraft:entity_anchor")? { - Ok(BrigadierParser::EntityAnchor) - } else if parser == ResourceLocation::new("minecraft:range")? { - Ok(BrigadierParser::Range { + match parser_type { + BrigadierParserType::Bool => Ok(BrigadierParser::Bool), + BrigadierParserType::Double => { + Ok(BrigadierParser::Double(BrigadierNumber::read_into(buf)?)) + } + BrigadierParserType::Float => { + Ok(BrigadierParser::Float(BrigadierNumber::read_into(buf)?)) + } + BrigadierParserType::Integer => { + Ok(BrigadierParser::Integer(BrigadierNumber::read_into(buf)?)) + } + BrigadierParserType::Long => { + Ok(BrigadierParser::Long(BrigadierNumber::read_into(buf)?)) + } + BrigadierParserType::String => { + Ok(BrigadierParser::String(BrigadierString::read_into(buf)?)) + } + BrigadierParserType::Entity { + single, + players_only, + } => Ok(BrigadierParser::Entity { + single, + players_only, + }), + BrigadierParserType::GameProfile => Ok(BrigadierParser::GameProfile), + BrigadierParserType::BlockPos => Ok(BrigadierParser::BlockPos), + BrigadierParserType::ColumnPos => Ok(BrigadierParser::ColumnPos), + BrigadierParserType::Vec3 => Ok(BrigadierParser::Vec3), + BrigadierParserType::Vec2 => Ok(BrigadierParser::Vec2), + BrigadierParserType::BlockState => Ok(BrigadierParser::BlockState), + BrigadierParserType::BlockPredicate => Ok(BrigadierParser::BlockPredicate), + BrigadierParserType::ItemStack => Ok(BrigadierParser::ItemStack), + BrigadierParserType::ItemPredicate => Ok(BrigadierParser::ItemPredicate), + BrigadierParserType::Color => Ok(BrigadierParser::Color), + BrigadierParserType::Component => Ok(BrigadierParser::Component), + BrigadierParserType::Message => Ok(BrigadierParser::Message), + BrigadierParserType::Nbt => Ok(BrigadierParser::Nbt), + BrigadierParserType::NbtPath => Ok(BrigadierParser::NbtPath), + BrigadierParserType::Objective => Ok(BrigadierParser::Objective), + BrigadierParserType::ObjectiveCriteira => Ok(BrigadierParser::ObjectiveCriteira), + BrigadierParserType::Operation => Ok(BrigadierParser::Operation), + BrigadierParserType::Particle => Ok(BrigadierParser::Particle), + BrigadierParserType::Rotation => Ok(BrigadierParser::Rotation), + BrigadierParserType::Angle => Ok(BrigadierParser::Angle), + BrigadierParserType::ScoreboardSlot => Ok(BrigadierParser::ScoreboardSlot), + BrigadierParserType::ScoreHolder => { + let flags = buf.read_byte()?; + Ok(BrigadierParser::ScoreHolder { + allows_multiple: flags & 0x01 != 0, + }) + } + BrigadierParserType::Swizzle => Ok(BrigadierParser::Swizzle), + BrigadierParserType::Team => Ok(BrigadierParser::Team), + BrigadierParserType::ItemSlot => Ok(BrigadierParser::ItemSlot), + BrigadierParserType::ResourceLocation => Ok(BrigadierParser::ResourceLocation), + BrigadierParserType::MobEffect => Ok(BrigadierParser::MobEffect), + BrigadierParserType::Function => Ok(BrigadierParser::Function), + BrigadierParserType::EntityAnchor => Ok(BrigadierParser::EntityAnchor), + BrigadierParserType::Range => Ok(BrigadierParser::Range { decimals_allowed: buf.read_boolean()?, - }) - } else if parser == ResourceLocation::new("minecraft:int_range")? { - Ok(BrigadierParser::IntRange) - } else if parser == ResourceLocation::new("minecraft:float_range")? { - Ok(BrigadierParser::FloatRange) - } else if parser == ResourceLocation::new("minecraft:item_enchantment")? { - Ok(BrigadierParser::ItemEnchantment) - } else if parser == ResourceLocation::new("minecraft:entity_summon")? { - Ok(BrigadierParser::EntitySummon) - } else if parser == ResourceLocation::new("minecraft:dimension")? { - Ok(BrigadierParser::Dimension) - } else if parser == ResourceLocation::new("minecraft:uuid")? { - Ok(BrigadierParser::Uuid) - } else if parser == ResourceLocation::new("minecraft:nbt_tag")? { - Ok(BrigadierParser::NbtTag) - } else if parser == ResourceLocation::new("minecraft:nbt_compound_tag")? { - Ok(BrigadierParser::NbtCompoundTag) - } else if parser == ResourceLocation::new("minecraft:time")? { - Ok(BrigadierParser::Time) - } else if parser == ResourceLocation::new("minecraft:resource_or_tag")? { - Ok(BrigadierParser::ResourceOrTag { + }), + BrigadierParserType::IntRange => Ok(BrigadierParser::IntRange), + BrigadierParserType::FloatRange => Ok(BrigadierParser::FloatRange), + BrigadierParserType::ItemEnchantment => Ok(BrigadierParser::ItemEnchantment), + BrigadierParserType::EntitySummon => Ok(BrigadierParser::EntitySummon), + BrigadierParserType::Dimension => Ok(BrigadierParser::Dimension), + BrigadierParserType::Uuid => Ok(BrigadierParser::Uuid), + BrigadierParserType::NbtTag => Ok(BrigadierParser::NbtTag), + BrigadierParserType::NbtCompoundTag => Ok(BrigadierParser::NbtCompoundTag), + BrigadierParserType::Time => Ok(BrigadierParser::Time), + BrigadierParserType::ResourceOrTag => Ok(BrigadierParser::ResourceOrTag { registry_key: buf.read_resource_location()?, - }) - } else if parser == ResourceLocation::new("minecraft:resource")? { - Ok(BrigadierParser::Resource { + }), + BrigadierParserType::Resource => Ok(BrigadierParser::Resource { registry_key: buf.read_resource_location()?, - }) - } else { - panic!("Unknown Brigadier parser: {}", parser) + }), } } } diff --git a/azalea-protocol/src/packets/game/clientbound_login_packet.rs b/azalea-protocol/src/packets/game/clientbound_login_packet.rs index b4a1b8d4..6ddc6b5a 100755 --- a/azalea-protocol/src/packets/game/clientbound_login_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_login_packet.rs @@ -1,4 +1,4 @@ -use azalea_core::{game_type::GameType, resource_location::ResourceLocation}; +use azalea_core::{game_type::GameType, resource_location::ResourceLocation, GlobalPos}; use packet_macros::{GamePacket, McBuf}; #[derive(Clone, Debug, McBuf, GamePacket)] @@ -9,7 +9,7 @@ pub struct ClientboundLoginPacket { pub previous_game_type: Option, pub levels: Vec, pub registry_holder: azalea_nbt::Tag, - pub dimension_type: azalea_nbt::Tag, + pub dimension_type: ResourceLocation, pub dimension: ResourceLocation, pub seed: i64, #[var] @@ -22,4 +22,5 @@ pub struct ClientboundLoginPacket { pub show_death_screen: bool, pub is_debug: bool, pub is_flat: bool, + pub last_death_location: Option, } diff --git a/azalea-protocol/src/packets/login/clientbound_hello_packet.rs b/azalea-protocol/src/packets/login/clientbound_hello_packet.rs index f7de4c21..58d48ffe 100755 --- a/azalea-protocol/src/packets/login/clientbound_hello_packet.rs +++ b/azalea-protocol/src/packets/login/clientbound_hello_packet.rs @@ -1,37 +1,11 @@ -use std::{ - hash::Hash, - io::{Read, Write}, -}; +use packet_macros::LoginPacket; +use packet_macros::McBuf; -use super::LoginPacket; -use crate::mc_buf::Readable; - -#[derive(Hash, Clone, Debug)] +#[derive(Clone, Debug, McBuf, LoginPacket)] pub struct ClientboundHelloPacket { + // TODO: make this len thing work + // #[len(20)] pub server_id: String, pub public_key: Vec, pub nonce: Vec, } - -impl ClientboundHelloPacket { - pub fn get(self) -> LoginPacket { - LoginPacket::ClientboundHelloPacket(self) - } - - pub fn write(&self, _buf: &mut impl Write) -> Result<(), std::io::Error> { - panic!("ClientboundHelloPacket::write not implemented") - } - - pub fn read(buf: &mut impl Read) -> Result { - let server_id = buf.read_utf_with_len(20)?; - let public_key = buf.read_byte_array()?; - let nonce = buf.read_byte_array()?; - - Ok(ClientboundHelloPacket { - server_id, - public_key, - nonce, - } - .get()) - } -} diff --git a/azalea-protocol/src/packets/login/serverbound_key_packet.rs b/azalea-protocol/src/packets/login/serverbound_key_packet.rs index 9100823d..2c970036 100644 --- a/azalea-protocol/src/packets/login/serverbound_key_packet.rs +++ b/azalea-protocol/src/packets/login/serverbound_key_packet.rs @@ -1,8 +1,49 @@ +use azalea_crypto::SaltSignaturePair; use packet_macros::{LoginPacket, McBuf}; -use std::hash::Hash; +use std::{ + hash::Hash, + io::{Read, Write}, +}; -#[derive(Hash, Clone, Debug, McBuf, LoginPacket)] +use crate::mc_buf::{McBufReadable, McBufWritable}; + +#[derive(Clone, Debug, McBuf, LoginPacket)] pub struct ServerboundKeyPacket { - pub shared_secret: Vec, - pub nonce: Vec, + pub key_bytes: Vec, + pub nonce_or_salt_signature: NonceOrSaltSignature, +} + +#[derive(Clone, Debug)] +pub enum NonceOrSaltSignature { + Nonce(Vec), + SaltSignature(SaltSignaturePair), +} + +impl McBufReadable for NonceOrSaltSignature { + fn read_into(buf: &mut impl Read) -> Result { + let is_nonce = bool::read_into(buf)?; + if is_nonce { + Ok(NonceOrSaltSignature::Nonce(Vec::::read_into(buf)?)) + } else { + Ok(NonceOrSaltSignature::SaltSignature( + SaltSignaturePair::read_into(buf)?, + )) + } + } +} + +impl McBufWritable for NonceOrSaltSignature { + fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { + match self { + NonceOrSaltSignature::Nonce(nonce) => { + bool::write_into(&true, buf)?; + nonce.write_into(buf)?; + } + NonceOrSaltSignature::SaltSignature(salt_signature) => { + bool::write_into(&false, buf)?; + salt_signature.write_into(buf)?; + } + } + Ok(()) + } } diff --git a/login.txt b/login.txt new file mode 100644 index 00000000..22a2dc6c --- /dev/null +++ b/login.txt @@ -0,0 +1,4812 @@ +ClientboundLoginPacket { + player_id: 30321, + hardcore: false, + game_type: CREATIVE, + previous_game_type: None, + levels: [ + minecraft:overworld, + minecraft:the_nether, + minecraft:the_end, + ], + registry_holder: Compound( + { + "": Compound( + { + "minecraft:chat_type": Compound( + { + "type": String( + "minecraft:chat_type", + ), + "value": List( + [ + Compound( + { + "id": Int( + 0, + ), + "name": String( + "minecraft:chat", + ), + "element": Compound( + { + "chat": Compound( + { + "decoration": Compound( + { + "style": Compound( + {}, + ), + "translation_key": String( + "chat.type.text", + ), + "parameters": List( + [ + String( + "sender", + ), + String( + "content", + ), + ], + ), + }, + ), + }, + ), + "narration": Compound( + { + "priority": String( + "chat", + ), + "decoration": Compound( + { + "translation_key": String( + "chat.type.text.narrate", + ), + "parameters": List( + [ + String( + "sender", + ), + String( + "content", + ), + ], + ), + "style": Compound( + {}, + ), + }, + ), + }, + ), + }, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:system", + ), + "id": Int( + 1, + ), + "element": Compound( + { + "chat": Compound( + {}, + ), + "narration": Compound( + { + "priority": String( + "system", + ), + }, + ), + }, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:game_info", + ), + "id": Int( + 2, + ), + "element": Compound( + { + "overlay": Compound( + {}, + ), + }, + ), + }, + ), + Compound( + { + "id": Int( + 3, + ), + "element": Compound( + { + "chat": Compound( + { + "decoration": Compound( + { + "translation_key": String( + "chat.type.announcement", + ), + "parameters": List( + [ + String( + "sender", + ), + String( + "content", + ), + ], + ), + "style": Compound( + {}, + ), + }, + ), + }, + ), + "narration": Compound( + { + "priority": String( + "chat", + ), + "decoration": Compound( + { + "translation_key": String( + "chat.type.text.narrate", + ), + "style": Compound( + {}, + ), + "parameters": List( + [ + String( + "sender", + ), + String( + "content", + ), + ], + ), + }, + ), + }, + ), + }, + ), + "name": String( + "minecraft:say_command", + ), + }, + ), + Compound( + { + "id": Int( + 4, + ), + "element": Compound( + { + "chat": Compound( + { + "decoration": Compound( + { + "parameters": List( + [ + String( + "sender", + ), + String( + "content", + ), + ], + ), + "translation_key": String( + "commands.message.display.incoming", + ), + "style": Compound( + { + "italic": Byte( + 1, + ), + "color": String( + "gray", + ), + }, + ), + }, + ), + }, + ), + "narration": Compound( + { + "priority": String( + "chat", + ), + "decoration": Compound( + { + "parameters": List( + [ + String( + "sender", + ), + String( + "content", + ), + ], + ), + "style": Compound( + {}, + ), + "translation_key": String( + "chat.type.text.narrate", + ), + }, + ), + }, + ), + }, + ), + "name": String( + "minecraft:msg_command", + ), + }, + ), + Compound( + { + "id": Int( + 5, + ), + "name": String( + "minecraft:team_msg_command", + ), + "element": Compound( + { + "narration": Compound( + { + "decoration": Compound( + { + "parameters": List( + [ + String( + "sender", + ), + String( + "content", + ), + ], + ), + "style": Compound( + {}, + ), + "translation_key": String( + "chat.type.text.narrate", + ), + }, + ), + "priority": String( + "chat", + ), + }, + ), + "chat": Compound( + { + "decoration": Compound( + { + "style": Compound( + {}, + ), + "parameters": List( + [ + String( + "team_name", + ), + String( + "sender", + ), + String( + "content", + ), + ], + ), + "translation_key": String( + "chat.type.team.text", + ), + }, + ), + }, + ), + }, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:emote_command", + ), + "id": Int( + 6, + ), + "element": Compound( + { + "narration": Compound( + { + "decoration": Compound( + { + "parameters": List( + [ + String( + "sender", + ), + String( + "content", + ), + ], + ), + "style": Compound( + {}, + ), + "translation_key": String( + "chat.type.emote", + ), + }, + ), + "priority": String( + "chat", + ), + }, + ), + "chat": Compound( + { + "decoration": Compound( + { + "translation_key": String( + "chat.type.emote", + ), + "parameters": List( + [ + String( + "sender", + ), + String( + "content", + ), + ], + ), + "style": Compound( + {}, + ), + }, + ), + }, + ), + }, + ), + }, + ), + Compound( + { + "element": Compound( + { + "narration": Compound( + { + "priority": String( + "chat", + ), + }, + ), + "chat": Compound( + {}, + ), + }, + ), + "name": String( + "minecraft:tellraw_command", + ), + "id": Int( + 7, + ), + }, + ), + ], + ), + }, + ), + "minecraft:worldgen/biome": Compound( + { + "type": String( + "minecraft:worldgen/biome", + ), + "value": List( + [ + Compound( + { + "element": Compound( + { + "precipitation": String( + "none", + ), + "temperature": Float( + 0.5, + ), + "effects": Compound( + { + "mood_sound": Compound( + { + "sound": String( + "minecraft:ambient.cave", + ), + "offset": Double( + 2.0, + ), + "block_search_extent": Int( + 8, + ), + "tick_delay": Int( + 6000, + ), + }, + ), + "water_fog_color": Int( + 329011, + ), + "sky_color": Int( + 8103167, + ), + "water_color": Int( + 4159204, + ), + "fog_color": Int( + 12638463, + ), + }, + ), + "downfall": Float( + 0.5, + ), + }, + ), + "id": Int( + 0, + ), + "name": String( + "minecraft:the_void", + ), + }, + ), + Compound( + { + "element": Compound( + { + "precipitation": String( + "rain", + ), + "temperature": Float( + 0.8, + ), + "downfall": Float( + 0.4, + ), + "effects": Compound( + { + "water_color": Int( + 4159204, + ), + "water_fog_color": Int( + 329011, + ), + "sky_color": Int( + 7907327, + ), + "fog_color": Int( + 12638463, + ), + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "block_search_extent": Int( + 8, + ), + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + }, + ), + }, + ), + "name": String( + "minecraft:plains", + ), + "id": Int( + 1, + ), + }, + ), + Compound( + { + "id": Int( + 2, + ), + "name": String( + "minecraft:sunflower_plains", + ), + "element": Compound( + { + "downfall": Float( + 0.4, + ), + "effects": Compound( + { + "water_fog_color": Int( + 329011, + ), + "mood_sound": Compound( + { + "offset": Double( + 2.0, + ), + "block_search_extent": Int( + 8, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "tick_delay": Int( + 6000, + ), + }, + ), + "fog_color": Int( + 12638463, + ), + "water_color": Int( + 4159204, + ), + "sky_color": Int( + 7907327, + ), + }, + ), + "precipitation": String( + "rain", + ), + "temperature": Float( + 0.8, + ), + }, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:snowy_plains", + ), + "element": Compound( + { + "downfall": Float( + 0.5, + ), + "temperature": Float( + 0.0, + ), + "effects": Compound( + { + "water_color": Int( + 4159204, + ), + "water_fog_color": Int( + 329011, + ), + "sky_color": Int( + 8364543, + ), + "fog_color": Int( + 12638463, + ), + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "block_search_extent": Int( + 8, + ), + }, + ), + }, + ), + "precipitation": String( + "snow", + ), + }, + ), + "id": Int( + 3, + ), + }, + ), + Compound( + { + "id": Int( + 4, + ), + "element": Compound( + { + "precipitation": String( + "snow", + ), + "effects": Compound( + { + "water_fog_color": Int( + 329011, + ), + "sky_color": Int( + 8364543, + ), + "fog_color": Int( + 12638463, + ), + "mood_sound": Compound( + { + "sound": String( + "minecraft:ambient.cave", + ), + "block_search_extent": Int( + 8, + ), + "offset": Double( + 2.0, + ), + "tick_delay": Int( + 6000, + ), + }, + ), + "water_color": Int( + 4159204, + ), + }, + ), + "downfall": Float( + 0.5, + ), + "temperature": Float( + 0.0, + ), + }, + ), + "name": String( + "minecraft:ice_spikes", + ), + }, + ), + Compound( + { + "name": String( + "minecraft:desert", + ), + "id": Int( + 5, + ), + "element": Compound( + { + "effects": Compound( + { + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "block_search_extent": Int( + 8, + ), + }, + ), + "sky_color": Int( + 7254527, + ), + "water_color": Int( + 4159204, + ), + "water_fog_color": Int( + 329011, + ), + "fog_color": Int( + 12638463, + ), + }, + ), + "temperature": Float( + 2.0, + ), + "precipitation": String( + "none", + ), + "downfall": Float( + 0.0, + ), + }, + ), + }, + ), + Compound( + { + "element": Compound( + { + "effects": Compound( + { + "water_fog_color": Int( + 2302743, + ), + "music": Compound( + { + "replace_current_music": Byte( + 0, + ), + "max_delay": Int( + 24000, + ), + "sound": String( + "minecraft:music.overworld.swamp", + ), + "min_delay": Int( + 12000, + ), + }, + ), + "fog_color": Int( + 12638463, + ), + "water_color": Int( + 6388580, + ), + "sky_color": Int( + 7907327, + ), + "mood_sound": Compound( + { + "sound": String( + "minecraft:ambient.cave", + ), + "block_search_extent": Int( + 8, + ), + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + }, + ), + "foliage_color": Int( + 6975545, + ), + "grass_color_modifier": String( + "swamp", + ), + }, + ), + "temperature": Float( + 0.8, + ), + "precipitation": String( + "rain", + ), + "downfall": Float( + 0.9, + ), + }, + ), + "name": String( + "minecraft:swamp", + ), + "id": Int( + 6, + ), + }, + ), + Compound( + { + "id": Int( + 7, + ), + "name": String( + "minecraft:mangrove_swamp", + ), + "element": Compound( + { + "effects": Compound( + { + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "block_search_extent": Int( + 8, + ), + }, + ), + "foliage_color": Int( + 9285927, + ), + "fog_color": Int( + 12638463, + ), + "music": Compound( + { + "sound": String( + "minecraft:music.overworld.swamp", + ), + "replace_current_music": Byte( + 0, + ), + "max_delay": Int( + 24000, + ), + "min_delay": Int( + 12000, + ), + }, + ), + "grass_color_modifier": String( + "swamp", + ), + "water_color": Int( + 3832426, + ), + "water_fog_color": Int( + 5077600, + ), + "sky_color": Int( + 7907327, + ), + }, + ), + "temperature": Float( + 0.8, + ), + "precipitation": String( + "rain", + ), + "downfall": Float( + 0.9, + ), + }, + ), + }, + ), + Compound( + { + "id": Int( + 8, + ), + "name": String( + "minecraft:forest", + ), + "element": Compound( + { + "temperature": Float( + 0.7, + ), + "effects": Compound( + { + "water_fog_color": Int( + 329011, + ), + "fog_color": Int( + 12638463, + ), + "mood_sound": Compound( + { + "block_search_extent": Int( + 8, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + }, + ), + "sky_color": Int( + 7972607, + ), + "water_color": Int( + 4159204, + ), + "music": Compound( + { + "replace_current_music": Byte( + 0, + ), + "min_delay": Int( + 12000, + ), + "sound": String( + "minecraft:music.overworld.jungle_and_forest", + ), + "max_delay": Int( + 24000, + ), + }, + ), + }, + ), + "precipitation": String( + "rain", + ), + "downfall": Float( + 0.8, + ), + }, + ), + }, + ), + Compound( + { + "element": Compound( + { + "temperature": Float( + 0.7, + ), + "effects": Compound( + { + "water_color": Int( + 4159204, + ), + "sky_color": Int( + 7972607, + ), + "water_fog_color": Int( + 329011, + ), + "fog_color": Int( + 12638463, + ), + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "block_search_extent": Int( + 8, + ), + }, + ), + "music": Compound( + { + "max_delay": Int( + 24000, + ), + "sound": String( + "minecraft:music.overworld.jungle_and_forest", + ), + "min_delay": Int( + 12000, + ), + "replace_current_music": Byte( + 0, + ), + }, + ), + }, + ), + "precipitation": String( + "rain", + ), + "downfall": Float( + 0.8, + ), + }, + ), + "name": String( + "minecraft:flower_forest", + ), + "id": Int( + 9, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:birch_forest", + ), + "id": Int( + 10, + ), + "element": Compound( + { + "precipitation": String( + "rain", + ), + "temperature": Float( + 0.6, + ), + "downfall": Float( + 0.6, + ), + "effects": Compound( + { + "fog_color": Int( + 12638463, + ), + "water_color": Int( + 4159204, + ), + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "block_search_extent": Int( + 8, + ), + }, + ), + "sky_color": Int( + 8037887, + ), + "water_fog_color": Int( + 329011, + ), + "music": Compound( + { + "min_delay": Int( + 12000, + ), + "sound": String( + "minecraft:music.overworld.jungle_and_forest", + ), + "replace_current_music": Byte( + 0, + ), + "max_delay": Int( + 24000, + ), + }, + ), + }, + ), + }, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:dark_forest", + ), + "id": Int( + 11, + ), + "element": Compound( + { + "downfall": Float( + 0.8, + ), + "precipitation": String( + "rain", + ), + "temperature": Float( + 0.7, + ), + "effects": Compound( + { + "sky_color": Int( + 7972607, + ), + "water_fog_color": Int( + 329011, + ), + "fog_color": Int( + 12638463, + ), + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "block_search_extent": Int( + 8, + ), + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + "grass_color_modifier": String( + "dark_forest", + ), + "water_color": Int( + 4159204, + ), + "music": Compound( + { + "min_delay": Int( + 12000, + ), + "replace_current_music": Byte( + 0, + ), + "max_delay": Int( + 24000, + ), + "sound": String( + "minecraft:music.overworld.jungle_and_forest", + ), + }, + ), + }, + ), + }, + ), + }, + ), + Compound( + { + "element": Compound( + { + "downfall": Float( + 0.6, + ), + "effects": Compound( + { + "sky_color": Int( + 8037887, + ), + "music": Compound( + { + "min_delay": Int( + 12000, + ), + "replace_current_music": Byte( + 0, + ), + "sound": String( + "minecraft:music.overworld.jungle_and_forest", + ), + "max_delay": Int( + 24000, + ), + }, + ), + "water_fog_color": Int( + 329011, + ), + "fog_color": Int( + 12638463, + ), + "water_color": Int( + 4159204, + ), + "mood_sound": Compound( + { + "block_search_extent": Int( + 8, + ), + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + }, + ), + "precipitation": String( + "rain", + ), + "temperature": Float( + 0.6, + ), + }, + ), + "name": String( + "minecraft:old_growth_birch_forest", + ), + "id": Int( + 12, + ), + }, + ), + Compound( + { + "element": Compound( + { + "precipitation": String( + "rain", + ), + "effects": Compound( + { + "music": Compound( + { + "min_delay": Int( + 12000, + ), + "max_delay": Int( + 24000, + ), + "sound": String( + "minecraft:music.overworld.old_growth_taiga", + ), + "replace_current_music": Byte( + 0, + ), + }, + ), + "water_fog_color": Int( + 329011, + ), + "water_color": Int( + 4159204, + ), + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "block_search_extent": Int( + 8, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "offset": Double( + 2.0, + ), + }, + ), + "fog_color": Int( + 12638463, + ), + "sky_color": Int( + 8168447, + ), + }, + ), + "temperature": Float( + 0.3, + ), + "downfall": Float( + 0.8, + ), + }, + ), + "id": Int( + 13, + ), + "name": String( + "minecraft:old_growth_pine_taiga", + ), + }, + ), + Compound( + { + "name": String( + "minecraft:old_growth_spruce_taiga", + ), + "element": Compound( + { + "precipitation": String( + "rain", + ), + "downfall": Float( + 0.8, + ), + "temperature": Float( + 0.25, + ), + "effects": Compound( + { + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "block_search_extent": Int( + 8, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + "sky_color": Int( + 8233983, + ), + "music": Compound( + { + "max_delay": Int( + 24000, + ), + "sound": String( + "minecraft:music.overworld.old_growth_taiga", + ), + "min_delay": Int( + 12000, + ), + "replace_current_music": Byte( + 0, + ), + }, + ), + "water_fog_color": Int( + 329011, + ), + "fog_color": Int( + 12638463, + ), + "water_color": Int( + 4159204, + ), + }, + ), + }, + ), + "id": Int( + 14, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:taiga", + ), + "id": Int( + 15, + ), + "element": Compound( + { + "downfall": Float( + 0.8, + ), + "precipitation": String( + "rain", + ), + "effects": Compound( + { + "water_fog_color": Int( + 329011, + ), + "water_color": Int( + 4159204, + ), + "sky_color": Int( + 8233983, + ), + "fog_color": Int( + 12638463, + ), + "mood_sound": Compound( + { + "block_search_extent": Int( + 8, + ), + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + }, + ), + "temperature": Float( + 0.25, + ), + }, + ), + }, + ), + Compound( + { + "element": Compound( + { + "precipitation": String( + "snow", + ), + "temperature": Float( + -0.5, + ), + "effects": Compound( + { + "water_color": Int( + 4020182, + ), + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "block_search_extent": Int( + 8, + ), + }, + ), + "water_fog_color": Int( + 329011, + ), + "sky_color": Int( + 8625919, + ), + "fog_color": Int( + 12638463, + ), + }, + ), + "downfall": Float( + 0.4, + ), + }, + ), + "name": String( + "minecraft:snowy_taiga", + ), + "id": Int( + 16, + ), + }, + ), + Compound( + { + "element": Compound( + { + "effects": Compound( + { + "sky_color": Int( + 7254527, + ), + "water_fog_color": Int( + 329011, + ), + "fog_color": Int( + 12638463, + ), + "water_color": Int( + 4159204, + ), + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "block_search_extent": Int( + 8, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + }, + ), + "precipitation": String( + "none", + ), + "downfall": Float( + 0.0, + ), + "temperature": Float( + 2.0, + ), + }, + ), + "name": String( + "minecraft:savanna", + ), + "id": Int( + 17, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:savanna_plateau", + ), + "element": Compound( + { + "precipitation": String( + "none", + ), + "effects": Compound( + { + "water_fog_color": Int( + 329011, + ), + "sky_color": Int( + 7254527, + ), + "fog_color": Int( + 12638463, + ), + "mood_sound": Compound( + { + "offset": Double( + 2.0, + ), + "block_search_extent": Int( + 8, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "tick_delay": Int( + 6000, + ), + }, + ), + "water_color": Int( + 4159204, + ), + }, + ), + "temperature": Float( + 2.0, + ), + "downfall": Float( + 0.0, + ), + }, + ), + "id": Int( + 18, + ), + }, + ), + Compound( + { + "element": Compound( + { + "effects": Compound( + { + "water_fog_color": Int( + 329011, + ), + "water_color": Int( + 4159204, + ), + "mood_sound": Compound( + { + "sound": String( + "minecraft:ambient.cave", + ), + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "block_search_extent": Int( + 8, + ), + }, + ), + "sky_color": Int( + 8233727, + ), + "fog_color": Int( + 12638463, + ), + }, + ), + "downfall": Float( + 0.3, + ), + "precipitation": String( + "rain", + ), + "temperature": Float( + 0.2, + ), + }, + ), + "id": Int( + 19, + ), + "name": String( + "minecraft:windswept_hills", + ), + }, + ), + Compound( + { + "id": Int( + 20, + ), + "element": Compound( + { + "effects": Compound( + { + "fog_color": Int( + 12638463, + ), + "mood_sound": Compound( + { + "block_search_extent": Int( + 8, + ), + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "tick_delay": Int( + 6000, + ), + }, + ), + "water_fog_color": Int( + 329011, + ), + "sky_color": Int( + 8233727, + ), + "water_color": Int( + 4159204, + ), + }, + ), + "temperature": Float( + 0.2, + ), + "downfall": Float( + 0.3, + ), + "precipitation": String( + "rain", + ), + }, + ), + "name": String( + "minecraft:windswept_gravelly_hills", + ), + }, + ), + Compound( + { + "element": Compound( + { + "temperature": Float( + 0.2, + ), + "downfall": Float( + 0.3, + ), + "effects": Compound( + { + "mood_sound": Compound( + { + "offset": Double( + 2.0, + ), + "block_search_extent": Int( + 8, + ), + "tick_delay": Int( + 6000, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + "water_fog_color": Int( + 329011, + ), + "fog_color": Int( + 12638463, + ), + "sky_color": Int( + 8233727, + ), + "water_color": Int( + 4159204, + ), + }, + ), + "precipitation": String( + "rain", + ), + }, + ), + "name": String( + "minecraft:windswept_forest", + ), + "id": Int( + 21, + ), + }, + ), + Compound( + { + "id": Int( + 22, + ), + "element": Compound( + { + "effects": Compound( + { + "mood_sound": Compound( + { + "sound": String( + "minecraft:ambient.cave", + ), + "block_search_extent": Int( + 8, + ), + "offset": Double( + 2.0, + ), + "tick_delay": Int( + 6000, + ), + }, + ), + "water_fog_color": Int( + 329011, + ), + "water_color": Int( + 4159204, + ), + "sky_color": Int( + 7254527, + ), + "fog_color": Int( + 12638463, + ), + }, + ), + "temperature": Float( + 2.0, + ), + "precipitation": String( + "none", + ), + "downfall": Float( + 0.0, + ), + }, + ), + "name": String( + "minecraft:windswept_savanna", + ), + }, + ), + Compound( + { + "element": Compound( + { + "downfall": Float( + 0.9, + ), + "temperature": Float( + 0.95, + ), + "effects": Compound( + { + "water_fog_color": Int( + 329011, + ), + "music": Compound( + { + "max_delay": Int( + 24000, + ), + "sound": String( + "minecraft:music.overworld.jungle_and_forest", + ), + "replace_current_music": Byte( + 0, + ), + "min_delay": Int( + 12000, + ), + }, + ), + "fog_color": Int( + 12638463, + ), + "water_color": Int( + 4159204, + ), + "mood_sound": Compound( + { + "sound": String( + "minecraft:ambient.cave", + ), + "offset": Double( + 2.0, + ), + "block_search_extent": Int( + 8, + ), + "tick_delay": Int( + 6000, + ), + }, + ), + "sky_color": Int( + 7842047, + ), + }, + ), + "precipitation": String( + "rain", + ), + }, + ), + "name": String( + "minecraft:jungle", + ), + "id": Int( + 23, + ), + }, + ), + Compound( + { + "id": Int( + 24, + ), + "element": Compound( + { + "temperature": Float( + 0.95, + ), + "precipitation": String( + "rain", + ), + "effects": Compound( + { + "water_color": Int( + 4159204, + ), + "water_fog_color": Int( + 329011, + ), + "music": Compound( + { + "min_delay": Int( + 12000, + ), + "sound": String( + "minecraft:music.overworld.jungle_and_forest", + ), + "replace_current_music": Byte( + 0, + ), + "max_delay": Int( + 24000, + ), + }, + ), + "sky_color": Int( + 7842047, + ), + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "block_search_extent": Int( + 8, + ), + "offset": Double( + 2.0, + ), + }, + ), + "fog_color": Int( + 12638463, + ), + }, + ), + "downfall": Float( + 0.8, + ), + }, + ), + "name": String( + "minecraft:sparse_jungle", + ), + }, + ), + Compound( + { + "name": String( + "minecraft:bamboo_jungle", + ), + "id": Int( + 25, + ), + "element": Compound( + { + "precipitation": String( + "rain", + ), + "temperature": Float( + 0.95, + ), + "effects": Compound( + { + "fog_color": Int( + 12638463, + ), + "music": Compound( + { + "min_delay": Int( + 12000, + ), + "max_delay": Int( + 24000, + ), + "replace_current_music": Byte( + 0, + ), + "sound": String( + "minecraft:music.overworld.jungle_and_forest", + ), + }, + ), + "sky_color": Int( + 7842047, + ), + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "offset": Double( + 2.0, + ), + "block_search_extent": Int( + 8, + ), + }, + ), + "water_fog_color": Int( + 329011, + ), + "water_color": Int( + 4159204, + ), + }, + ), + "downfall": Float( + 0.9, + ), + }, + ), + }, + ), + Compound( + { + "id": Int( + 26, + ), + "name": String( + "minecraft:badlands", + ), + "element": Compound( + { + "temperature": Float( + 2.0, + ), + "effects": Compound( + { + "water_color": Int( + 4159204, + ), + "foliage_color": Int( + 10387789, + ), + "mood_sound": Compound( + { + "sound": String( + "minecraft:ambient.cave", + ), + "tick_delay": Int( + 6000, + ), + "block_search_extent": Int( + 8, + ), + "offset": Double( + 2.0, + ), + }, + ), + "sky_color": Int( + 7254527, + ), + "fog_color": Int( + 12638463, + ), + "grass_color": Int( + 9470285, + ), + "water_fog_color": Int( + 329011, + ), + }, + ), + "precipitation": String( + "none", + ), + "downfall": Float( + 0.0, + ), + }, + ), + }, + ), + Compound( + { + "element": Compound( + { + "temperature": Float( + 2.0, + ), + "precipitation": String( + "none", + ), + "downfall": Float( + 0.0, + ), + "effects": Compound( + { + "water_fog_color": Int( + 329011, + ), + "fog_color": Int( + 12638463, + ), + "water_color": Int( + 4159204, + ), + "mood_sound": Compound( + { + "block_search_extent": Int( + 8, + ), + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "tick_delay": Int( + 6000, + ), + }, + ), + "sky_color": Int( + 7254527, + ), + "foliage_color": Int( + 10387789, + ), + "grass_color": Int( + 9470285, + ), + }, + ), + }, + ), + "id": Int( + 27, + ), + "name": String( + "minecraft:eroded_badlands", + ), + }, + ), + Compound( + { + "id": Int( + 28, + ), + "name": String( + "minecraft:wooded_badlands", + ), + "element": Compound( + { + "effects": Compound( + { + "water_fog_color": Int( + 329011, + ), + "water_color": Int( + 4159204, + ), + "sky_color": Int( + 7254527, + ), + "mood_sound": Compound( + { + "offset": Double( + 2.0, + ), + "block_search_extent": Int( + 8, + ), + "tick_delay": Int( + 6000, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + "fog_color": Int( + 12638463, + ), + "foliage_color": Int( + 10387789, + ), + "grass_color": Int( + 9470285, + ), + }, + ), + "precipitation": String( + "none", + ), + "downfall": Float( + 0.0, + ), + "temperature": Float( + 2.0, + ), + }, + ), + }, + ), + Compound( + { + "element": Compound( + { + "effects": Compound( + { + "music": Compound( + { + "max_delay": Int( + 24000, + ), + "sound": String( + "minecraft:music.overworld.meadow", + ), + "min_delay": Int( + 12000, + ), + "replace_current_music": Byte( + 0, + ), + }, + ), + "water_color": Int( + 937679, + ), + "sky_color": Int( + 8103167, + ), + "fog_color": Int( + 12638463, + ), + "mood_sound": Compound( + { + "block_search_extent": Int( + 8, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "offset": Double( + 2.0, + ), + "tick_delay": Int( + 6000, + ), + }, + ), + "water_fog_color": Int( + 329011, + ), + }, + ), + "precipitation": String( + "rain", + ), + "temperature": Float( + 0.5, + ), + "downfall": Float( + 0.8, + ), + }, + ), + "name": String( + "minecraft:meadow", + ), + "id": Int( + 29, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:grove", + ), + "id": Int( + 30, + ), + "element": Compound( + { + "precipitation": String( + "snow", + ), + "downfall": Float( + 0.8, + ), + "effects": Compound( + { + "fog_color": Int( + 12638463, + ), + "music": Compound( + { + "replace_current_music": Byte( + 0, + ), + "sound": String( + "minecraft:music.overworld.grove", + ), + "min_delay": Int( + 12000, + ), + "max_delay": Int( + 24000, + ), + }, + ), + "water_fog_color": Int( + 329011, + ), + "water_color": Int( + 4159204, + ), + "sky_color": Int( + 8495359, + ), + "mood_sound": Compound( + { + "block_search_extent": Int( + 8, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "offset": Double( + 2.0, + ), + "tick_delay": Int( + 6000, + ), + }, + ), + }, + ), + "temperature": Float( + -0.2, + ), + }, + ), + }, + ), + Compound( + { + "element": Compound( + { + "temperature": Float( + -0.3, + ), + "downfall": Float( + 0.9, + ), + "precipitation": String( + "snow", + ), + "effects": Compound( + { + "music": Compound( + { + "min_delay": Int( + 12000, + ), + "max_delay": Int( + 24000, + ), + "replace_current_music": Byte( + 0, + ), + "sound": String( + "minecraft:music.overworld.snowy_slopes", + ), + }, + ), + "water_color": Int( + 4159204, + ), + "mood_sound": Compound( + { + "sound": String( + "minecraft:ambient.cave", + ), + "offset": Double( + 2.0, + ), + "tick_delay": Int( + 6000, + ), + "block_search_extent": Int( + 8, + ), + }, + ), + "sky_color": Int( + 8560639, + ), + "water_fog_color": Int( + 329011, + ), + "fog_color": Int( + 12638463, + ), + }, + ), + }, + ), + "id": Int( + 31, + ), + "name": String( + "minecraft:snowy_slopes", + ), + }, + ), + Compound( + { + "id": Int( + 32, + ), + "element": Compound( + { + "effects": Compound( + { + "music": Compound( + { + "max_delay": Int( + 24000, + ), + "replace_current_music": Byte( + 0, + ), + "min_delay": Int( + 12000, + ), + "sound": String( + "minecraft:music.overworld.frozen_peaks", + ), + }, + ), + "sky_color": Int( + 8756735, + ), + "water_fog_color": Int( + 329011, + ), + "fog_color": Int( + 12638463, + ), + "water_color": Int( + 4159204, + ), + "mood_sound": Compound( + { + "block_search_extent": Int( + 8, + ), + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + }, + ), + "precipitation": String( + "snow", + ), + "temperature": Float( + -0.7, + ), + "downfall": Float( + 0.9, + ), + }, + ), + "name": String( + "minecraft:frozen_peaks", + ), + }, + ), + Compound( + { + "id": Int( + 33, + ), + "name": String( + "minecraft:jagged_peaks", + ), + "element": Compound( + { + "precipitation": String( + "snow", + ), + "effects": Compound( + { + "water_fog_color": Int( + 329011, + ), + "water_color": Int( + 4159204, + ), + "music": Compound( + { + "min_delay": Int( + 12000, + ), + "sound": String( + "minecraft:music.overworld.jagged_peaks", + ), + "replace_current_music": Byte( + 0, + ), + "max_delay": Int( + 24000, + ), + }, + ), + "sky_color": Int( + 8756735, + ), + "mood_sound": Compound( + { + "block_search_extent": Int( + 8, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + }, + ), + "fog_color": Int( + 12638463, + ), + }, + ), + "temperature": Float( + -0.7, + ), + "downfall": Float( + 0.9, + ), + }, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:stony_peaks", + ), + "id": Int( + 34, + ), + "element": Compound( + { + "downfall": Float( + 0.3, + ), + "effects": Compound( + { + "water_fog_color": Int( + 329011, + ), + "music": Compound( + { + "min_delay": Int( + 12000, + ), + "replace_current_music": Byte( + 0, + ), + "sound": String( + "minecraft:music.overworld.stony_peaks", + ), + "max_delay": Int( + 24000, + ), + }, + ), + "sky_color": Int( + 7776511, + ), + "water_color": Int( + 4159204, + ), + "fog_color": Int( + 12638463, + ), + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "block_search_extent": Int( + 8, + ), + "offset": Double( + 2.0, + ), + }, + ), + }, + ), + "precipitation": String( + "rain", + ), + "temperature": Float( + 1.0, + ), + }, + ), + }, + ), + Compound( + { + "element": Compound( + { + "downfall": Float( + 0.5, + ), + "precipitation": String( + "rain", + ), + "effects": Compound( + { + "fog_color": Int( + 12638463, + ), + "water_fog_color": Int( + 329011, + ), + "water_color": Int( + 4159204, + ), + "sky_color": Int( + 8103167, + ), + "mood_sound": Compound( + { + "sound": String( + "minecraft:ambient.cave", + ), + "tick_delay": Int( + 6000, + ), + "block_search_extent": Int( + 8, + ), + "offset": Double( + 2.0, + ), + }, + ), + }, + ), + "temperature": Float( + 0.5, + ), + }, + ), + "id": Int( + 35, + ), + "name": String( + "minecraft:river", + ), + }, + ), + Compound( + { + "element": Compound( + { + "precipitation": String( + "snow", + ), + "temperature": Float( + 0.0, + ), + "effects": Compound( + { + "water_fog_color": Int( + 329011, + ), + "sky_color": Int( + 8364543, + ), + "fog_color": Int( + 12638463, + ), + "water_color": Int( + 3750089, + ), + "mood_sound": Compound( + { + "block_search_extent": Int( + 8, + ), + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + }, + ), + "downfall": Float( + 0.5, + ), + }, + ), + "name": String( + "minecraft:frozen_river", + ), + "id": Int( + 36, + ), + }, + ), + Compound( + { + "element": Compound( + { + "downfall": Float( + 0.4, + ), + "precipitation": String( + "rain", + ), + "effects": Compound( + { + "water_fog_color": Int( + 329011, + ), + "fog_color": Int( + 12638463, + ), + "sky_color": Int( + 7907327, + ), + "mood_sound": Compound( + { + "sound": String( + "minecraft:ambient.cave", + ), + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "block_search_extent": Int( + 8, + ), + }, + ), + "water_color": Int( + 4159204, + ), + }, + ), + "temperature": Float( + 0.8, + ), + }, + ), + "name": String( + "minecraft:beach", + ), + "id": Int( + 37, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:snowy_beach", + ), + "id": Int( + 38, + ), + "element": Compound( + { + "temperature": Float( + 0.05, + ), + "downfall": Float( + 0.3, + ), + "precipitation": String( + "snow", + ), + "effects": Compound( + { + "sky_color": Int( + 8364543, + ), + "water_color": Int( + 4020182, + ), + "water_fog_color": Int( + 329011, + ), + "fog_color": Int( + 12638463, + ), + "mood_sound": Compound( + { + "offset": Double( + 2.0, + ), + "tick_delay": Int( + 6000, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "block_search_extent": Int( + 8, + ), + }, + ), + }, + ), + }, + ), + }, + ), + Compound( + { + "element": Compound( + { + "precipitation": String( + "rain", + ), + "temperature": Float( + 0.2, + ), + "downfall": Float( + 0.3, + ), + "effects": Compound( + { + "sky_color": Int( + 8233727, + ), + "fog_color": Int( + 12638463, + ), + "water_color": Int( + 4159204, + ), + "mood_sound": Compound( + { + "offset": Double( + 2.0, + ), + "block_search_extent": Int( + 8, + ), + "tick_delay": Int( + 6000, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + "water_fog_color": Int( + 329011, + ), + }, + ), + }, + ), + "name": String( + "minecraft:stony_shore", + ), + "id": Int( + 39, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:warm_ocean", + ), + "id": Int( + 40, + ), + "element": Compound( + { + "effects": Compound( + { + "sky_color": Int( + 8103167, + ), + "water_fog_color": Int( + 270131, + ), + "water_color": Int( + 4445678, + ), + "fog_color": Int( + 12638463, + ), + "mood_sound": Compound( + { + "offset": Double( + 2.0, + ), + "tick_delay": Int( + 6000, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "block_search_extent": Int( + 8, + ), + }, + ), + }, + ), + "temperature": Float( + 0.5, + ), + "downfall": Float( + 0.5, + ), + "precipitation": String( + "rain", + ), + }, + ), + }, + ), + Compound( + { + "element": Compound( + { + "effects": Compound( + { + "mood_sound": Compound( + { + "block_search_extent": Int( + 8, + ), + "tick_delay": Int( + 6000, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "offset": Double( + 2.0, + ), + }, + ), + "fog_color": Int( + 12638463, + ), + "water_fog_color": Int( + 267827, + ), + "water_color": Int( + 4566514, + ), + "sky_color": Int( + 8103167, + ), + }, + ), + "precipitation": String( + "rain", + ), + "temperature": Float( + 0.5, + ), + "downfall": Float( + 0.5, + ), + }, + ), + "name": String( + "minecraft:lukewarm_ocean", + ), + "id": Int( + 41, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:deep_lukewarm_ocean", + ), + "id": Int( + 42, + ), + "element": Compound( + { + "downfall": Float( + 0.5, + ), + "temperature": Float( + 0.5, + ), + "effects": Compound( + { + "water_color": Int( + 4566514, + ), + "mood_sound": Compound( + { + "offset": Double( + 2.0, + ), + "block_search_extent": Int( + 8, + ), + "tick_delay": Int( + 6000, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + "sky_color": Int( + 8103167, + ), + "water_fog_color": Int( + 267827, + ), + "fog_color": Int( + 12638463, + ), + }, + ), + "precipitation": String( + "rain", + ), + }, + ), + }, + ), + Compound( + { + "id": Int( + 43, + ), + "element": Compound( + { + "temperature": Float( + 0.5, + ), + "precipitation": String( + "rain", + ), + "downfall": Float( + 0.5, + ), + "effects": Compound( + { + "water_color": Int( + 4159204, + ), + "mood_sound": Compound( + { + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "block_search_extent": Int( + 8, + ), + "tick_delay": Int( + 6000, + ), + }, + ), + "fog_color": Int( + 12638463, + ), + "water_fog_color": Int( + 329011, + ), + "sky_color": Int( + 8103167, + ), + }, + ), + }, + ), + "name": String( + "minecraft:ocean", + ), + }, + ), + Compound( + { + "name": String( + "minecraft:deep_ocean", + ), + "element": Compound( + { + "downfall": Float( + 0.5, + ), + "effects": Compound( + { + "mood_sound": Compound( + { + "block_search_extent": Int( + 8, + ), + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + "sky_color": Int( + 8103167, + ), + "water_fog_color": Int( + 329011, + ), + "water_color": Int( + 4159204, + ), + "fog_color": Int( + 12638463, + ), + }, + ), + "temperature": Float( + 0.5, + ), + "precipitation": String( + "rain", + ), + }, + ), + "id": Int( + 44, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:cold_ocean", + ), + "id": Int( + 45, + ), + "element": Compound( + { + "effects": Compound( + { + "fog_color": Int( + 12638463, + ), + "water_color": Int( + 4020182, + ), + "water_fog_color": Int( + 329011, + ), + "sky_color": Int( + 8103167, + ), + "mood_sound": Compound( + { + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "tick_delay": Int( + 6000, + ), + "block_search_extent": Int( + 8, + ), + }, + ), + }, + ), + "temperature": Float( + 0.5, + ), + "precipitation": String( + "rain", + ), + "downfall": Float( + 0.5, + ), + }, + ), + }, + ), + Compound( + { + "id": Int( + 46, + ), + "element": Compound( + { + "precipitation": String( + "rain", + ), + "effects": Compound( + { + "fog_color": Int( + 12638463, + ), + "water_fog_color": Int( + 329011, + ), + "water_color": Int( + 4020182, + ), + "mood_sound": Compound( + { + "block_search_extent": Int( + 8, + ), + "offset": Double( + 2.0, + ), + "tick_delay": Int( + 6000, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + "sky_color": Int( + 8103167, + ), + }, + ), + "temperature": Float( + 0.5, + ), + "downfall": Float( + 0.5, + ), + }, + ), + "name": String( + "minecraft:deep_cold_ocean", + ), + }, + ), + Compound( + { + "id": Int( + 47, + ), + "name": String( + "minecraft:frozen_ocean", + ), + "element": Compound( + { + "temperature_modifier": String( + "frozen", + ), + "temperature": Float( + 0.0, + ), + "precipitation": String( + "snow", + ), + "effects": Compound( + { + "sky_color": Int( + 8364543, + ), + "water_fog_color": Int( + 329011, + ), + "water_color": Int( + 3750089, + ), + "mood_sound": Compound( + { + "block_search_extent": Int( + 8, + ), + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + "fog_color": Int( + 12638463, + ), + }, + ), + "downfall": Float( + 0.5, + ), + }, + ), + }, + ), + Compound( + { + "id": Int( + 48, + ), + "element": Compound( + { + "downfall": Float( + 0.5, + ), + "temperature_modifier": String( + "frozen", + ), + "precipitation": String( + "rain", + ), + "effects": Compound( + { + "water_fog_color": Int( + 329011, + ), + "sky_color": Int( + 8103167, + ), + "fog_color": Int( + 12638463, + ), + "mood_sound": Compound( + { + "sound": String( + "minecraft:ambient.cave", + ), + "tick_delay": Int( + 6000, + ), + "block_search_extent": Int( + 8, + ), + "offset": Double( + 2.0, + ), + }, + ), + "water_color": Int( + 3750089, + ), + }, + ), + "temperature": Float( + 0.5, + ), + }, + ), + "name": String( + "minecraft:deep_frozen_ocean", + ), + }, + ), + Compound( + { + "element": Compound( + { + "downfall": Float( + 1.0, + ), + "temperature": Float( + 0.9, + ), + "precipitation": String( + "rain", + ), + "effects": Compound( + { + "water_color": Int( + 4159204, + ), + "water_fog_color": Int( + 329011, + ), + "fog_color": Int( + 12638463, + ), + "sky_color": Int( + 7842047, + ), + "mood_sound": Compound( + { + "sound": String( + "minecraft:ambient.cave", + ), + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "block_search_extent": Int( + 8, + ), + }, + ), + }, + ), + }, + ), + "id": Int( + 49, + ), + "name": String( + "minecraft:mushroom_fields", + ), + }, + ), + Compound( + { + "element": Compound( + { + "precipitation": String( + "rain", + ), + "temperature": Float( + 0.8, + ), + "downfall": Float( + 0.4, + ), + "effects": Compound( + { + "fog_color": Int( + 12638463, + ), + "water_color": Int( + 4159204, + ), + "water_fog_color": Int( + 329011, + ), + "mood_sound": Compound( + { + "offset": Double( + 2.0, + ), + "block_search_extent": Int( + 8, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "tick_delay": Int( + 6000, + ), + }, + ), + "sky_color": Int( + 7907327, + ), + "music": Compound( + { + "max_delay": Int( + 24000, + ), + "sound": String( + "minecraft:music.overworld.dripstone_caves", + ), + "replace_current_music": Byte( + 0, + ), + "min_delay": Int( + 12000, + ), + }, + ), + }, + ), + }, + ), + "name": String( + "minecraft:dripstone_caves", + ), + "id": Int( + 50, + ), + }, + ), + Compound( + { + "id": Int( + 51, + ), + "name": String( + "minecraft:lush_caves", + ), + "element": Compound( + { + "effects": Compound( + { + "water_fog_color": Int( + 329011, + ), + "fog_color": Int( + 12638463, + ), + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "block_search_extent": Int( + 8, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "offset": Double( + 2.0, + ), + }, + ), + "music": Compound( + { + "max_delay": Int( + 24000, + ), + "min_delay": Int( + 12000, + ), + "sound": String( + "minecraft:music.overworld.lush_caves", + ), + "replace_current_music": Byte( + 0, + ), + }, + ), + "water_color": Int( + 4159204, + ), + "sky_color": Int( + 8103167, + ), + }, + ), + "temperature": Float( + 0.5, + ), + "precipitation": String( + "rain", + ), + "downfall": Float( + 0.5, + ), + }, + ), + }, + ), + Compound( + { + "element": Compound( + { + "precipitation": String( + "rain", + ), + "temperature": Float( + 0.8, + ), + "effects": Compound( + { + "mood_sound": Compound( + { + "block_search_extent": Int( + 8, + ), + "offset": Double( + 2.0, + ), + "tick_delay": Int( + 6000, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + "water_fog_color": Int( + 329011, + ), + "fog_color": Int( + 12638463, + ), + "music": Compound( + { + "min_delay": Int( + 12000, + ), + "max_delay": Int( + 24000, + ), + "replace_current_music": Byte( + 0, + ), + "sound": String( + "minecraft:music.overworld.deep_dark", + ), + }, + ), + "water_color": Int( + 4159204, + ), + "sky_color": Int( + 7907327, + ), + }, + ), + "downfall": Float( + 0.4, + ), + }, + ), + "id": Int( + 52, + ), + "name": String( + "minecraft:deep_dark", + ), + }, + ), + Compound( + { + "id": Int( + 53, + ), + "name": String( + "minecraft:nether_wastes", + ), + "element": Compound( + { + "effects": Compound( + { + "music": Compound( + { + "max_delay": Int( + 24000, + ), + "sound": String( + "minecraft:music.nether.nether_wastes", + ), + "min_delay": Int( + 12000, + ), + "replace_current_music": Byte( + 0, + ), + }, + ), + "water_color": Int( + 4159204, + ), + "sky_color": Int( + 7254527, + ), + "additions_sound": Compound( + { + "sound": String( + "minecraft:ambient.nether_wastes.additions", + ), + "tick_chance": Double( + 0.0111, + ), + }, + ), + "water_fog_color": Int( + 329011, + ), + "mood_sound": Compound( + { + "offset": Double( + 2.0, + ), + "block_search_extent": Int( + 8, + ), + "sound": String( + "minecraft:ambient.nether_wastes.mood", + ), + "tick_delay": Int( + 6000, + ), + }, + ), + "ambient_sound": String( + "minecraft:ambient.nether_wastes.loop", + ), + "fog_color": Int( + 3344392, + ), + }, + ), + "temperature": Float( + 2.0, + ), + "downfall": Float( + 0.0, + ), + "precipitation": String( + "none", + ), + }, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:warped_forest", + ), + "id": Int( + 54, + ), + "element": Compound( + { + "downfall": Float( + 0.0, + ), + "precipitation": String( + "none", + ), + "temperature": Float( + 2.0, + ), + "effects": Compound( + { + "ambient_sound": String( + "minecraft:ambient.warped_forest.loop", + ), + "particle": Compound( + { + "probability": Float( + 0.01428, + ), + "options": Compound( + { + "type": String( + "minecraft:warped_spore", + ), + }, + ), + }, + ), + "additions_sound": Compound( + { + "tick_chance": Double( + 0.0111, + ), + "sound": String( + "minecraft:ambient.warped_forest.additions", + ), + }, + ), + "water_fog_color": Int( + 329011, + ), + "fog_color": Int( + 1705242, + ), + "music": Compound( + { + "replace_current_music": Byte( + 0, + ), + "sound": String( + "minecraft:music.nether.warped_forest", + ), + "min_delay": Int( + 12000, + ), + "max_delay": Int( + 24000, + ), + }, + ), + "water_color": Int( + 4159204, + ), + "sky_color": Int( + 7254527, + ), + "mood_sound": Compound( + { + "offset": Double( + 2.0, + ), + "tick_delay": Int( + 6000, + ), + "sound": String( + "minecraft:ambient.warped_forest.mood", + ), + "block_search_extent": Int( + 8, + ), + }, + ), + }, + ), + }, + ), + }, + ), + Compound( + { + "id": Int( + 55, + ), + "name": String( + "minecraft:crimson_forest", + ), + "element": Compound( + { + "effects": Compound( + { + "ambient_sound": String( + "minecraft:ambient.crimson_forest.loop", + ), + "sky_color": Int( + 7254527, + ), + "fog_color": Int( + 3343107, + ), + "water_color": Int( + 4159204, + ), + "mood_sound": Compound( + { + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.crimson_forest.mood", + ), + "tick_delay": Int( + 6000, + ), + "block_search_extent": Int( + 8, + ), + }, + ), + "music": Compound( + { + "replace_current_music": Byte( + 0, + ), + "max_delay": Int( + 24000, + ), + "min_delay": Int( + 12000, + ), + "sound": String( + "minecraft:music.nether.crimson_forest", + ), + }, + ), + "additions_sound": Compound( + { + "sound": String( + "minecraft:ambient.crimson_forest.additions", + ), + "tick_chance": Double( + 0.0111, + ), + }, + ), + "particle": Compound( + { + "probability": Float( + 0.025, + ), + "options": Compound( + { + "type": String( + "minecraft:crimson_spore", + ), + }, + ), + }, + ), + "water_fog_color": Int( + 329011, + ), + }, + ), + "temperature": Float( + 2.0, + ), + "downfall": Float( + 0.0, + ), + "precipitation": String( + "none", + ), + }, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:soul_sand_valley", + ), + "id": Int( + 56, + ), + "element": Compound( + { + "downfall": Float( + 0.0, + ), + "effects": Compound( + { + "sky_color": Int( + 7254527, + ), + "music": Compound( + { + "min_delay": Int( + 12000, + ), + "replace_current_music": Byte( + 0, + ), + "sound": String( + "minecraft:music.nether.soul_sand_valley", + ), + "max_delay": Int( + 24000, + ), + }, + ), + "ambient_sound": String( + "minecraft:ambient.soul_sand_valley.loop", + ), + "particle": Compound( + { + "options": Compound( + { + "type": String( + "minecraft:ash", + ), + }, + ), + "probability": Float( + 0.00625, + ), + }, + ), + "water_color": Int( + 4159204, + ), + "mood_sound": Compound( + { + "block_search_extent": Int( + 8, + ), + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.soul_sand_valley.mood", + ), + }, + ), + "additions_sound": Compound( + { + "sound": String( + "minecraft:ambient.soul_sand_valley.additions", + ), + "tick_chance": Double( + 0.0111, + ), + }, + ), + "water_fog_color": Int( + 329011, + ), + "fog_color": Int( + 1787717, + ), + }, + ), + "precipitation": String( + "none", + ), + "temperature": Float( + 2.0, + ), + }, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:basalt_deltas", + ), + "id": Int( + 57, + ), + "element": Compound( + { + "downfall": Float( + 0.0, + ), + "effects": Compound( + { + "water_color": Int( + 4159204, + ), + "water_fog_color": Int( + 329011, + ), + "fog_color": Int( + 6840176, + ), + "sky_color": Int( + 7254527, + ), + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "block_search_extent": Int( + 8, + ), + "sound": String( + "minecraft:ambient.basalt_deltas.mood", + ), + "offset": Double( + 2.0, + ), + }, + ), + "music": Compound( + { + "min_delay": Int( + 12000, + ), + "max_delay": Int( + 24000, + ), + "replace_current_music": Byte( + 0, + ), + "sound": String( + "minecraft:music.nether.basalt_deltas", + ), + }, + ), + "ambient_sound": String( + "minecraft:ambient.basalt_deltas.loop", + ), + "additions_sound": Compound( + { + "sound": String( + "minecraft:ambient.basalt_deltas.additions", + ), + "tick_chance": Double( + 0.0111, + ), + }, + ), + "particle": Compound( + { + "probability": Float( + 0.118093334, + ), + "options": Compound( + { + "type": String( + "minecraft:white_ash", + ), + }, + ), + }, + ), + }, + ), + "temperature": Float( + 2.0, + ), + "precipitation": String( + "none", + ), + }, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:the_end", + ), + "element": Compound( + { + "temperature": Float( + 0.5, + ), + "effects": Compound( + { + "fog_color": Int( + 10518688, + ), + "sky_color": Int( + 0, + ), + "water_fog_color": Int( + 329011, + ), + "water_color": Int( + 4159204, + ), + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "block_search_extent": Int( + 8, + ), + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + }, + ), + "downfall": Float( + 0.5, + ), + "precipitation": String( + "none", + ), + }, + ), + "id": Int( + 58, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:end_highlands", + ), + "id": Int( + 59, + ), + "element": Compound( + { + "downfall": Float( + 0.5, + ), + "temperature": Float( + 0.5, + ), + "precipitation": String( + "none", + ), + "effects": Compound( + { + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "block_search_extent": Int( + 8, + ), + }, + ), + "fog_color": Int( + 10518688, + ), + "sky_color": Int( + 0, + ), + "water_fog_color": Int( + 329011, + ), + "water_color": Int( + 4159204, + ), + }, + ), + }, + ), + }, + ), + Compound( + { + "element": Compound( + { + "temperature": Float( + 0.5, + ), + "downfall": Float( + 0.5, + ), + "precipitation": String( + "none", + ), + "effects": Compound( + { + "sky_color": Int( + 0, + ), + "water_color": Int( + 4159204, + ), + "water_fog_color": Int( + 329011, + ), + "fog_color": Int( + 10518688, + ), + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "block_search_extent": Int( + 8, + ), + "offset": Double( + 2.0, + ), + }, + ), + }, + ), + }, + ), + "name": String( + "minecraft:end_midlands", + ), + "id": Int( + 60, + ), + }, + ), + Compound( + { + "id": Int( + 61, + ), + "name": String( + "minecraft:small_end_islands", + ), + "element": Compound( + { + "temperature": Float( + 0.5, + ), + "precipitation": String( + "none", + ), + "effects": Compound( + { + "sky_color": Int( + 0, + ), + "mood_sound": Compound( + { + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "tick_delay": Int( + 6000, + ), + "block_search_extent": Int( + 8, + ), + }, + ), + "fog_color": Int( + 10518688, + ), + "water_fog_color": Int( + 329011, + ), + "water_color": Int( + 4159204, + ), + }, + ), + "downfall": Float( + 0.5, + ), + }, + ), + }, + ), + Compound( + { + "id": Int( + 62, + ), + "element": Compound( + { + "temperature": Float( + 0.5, + ), + "downfall": Float( + 0.5, + ), + "precipitation": String( + "none", + ), + "effects": Compound( + { + "water_fog_color": Int( + 329011, + ), + "water_color": Int( + 4159204, + ), + "fog_color": Int( + 10518688, + ), + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "block_search_extent": Int( + 8, + ), + }, + ), + "sky_color": Int( + 0, + ), + }, + ), + }, + ), + "name": String( + "minecraft:end_barrens", + ), + }, + ), + ], + ), + }, + ), + "minecraft:dimension_type": Compound( + { + "type": String( + "minecraft:dimension_type", + ), + "value": List( + [ + Compound( + { + "id": Int( + 0, + ), + "name": String( + "minecraft:overworld", + ), + "element": Compound( + { + "infiniburn": String( + "#minecraft:infiniburn_overworld", + ), + "respawn_anchor_works": Byte( + 0, + ), + "bed_works": Byte( + 1, + ), + "has_skylight": Byte( + 1, + ), + "natural": Byte( + 1, + ), + "effects": String( + "minecraft:overworld", + ), + "height": Int( + 384, + ), + "monster_spawn_light_level": Compound( + { + "type": String( + "minecraft:uniform", + ), + "value": Compound( + { + "min_inclusive": Int( + 0, + ), + "max_inclusive": Int( + 7, + ), + }, + ), + }, + ), + "has_raids": Byte( + 1, + ), + "ultrawarm": Byte( + 0, + ), + "min_y": Int( + -64, + ), + "monster_spawn_block_light_limit": Int( + 0, + ), + "logical_height": Int( + 384, + ), + "ambient_light": Float( + 0.0, + ), + "coordinate_scale": Double( + 1.0, + ), + "piglin_safe": Byte( + 0, + ), + "has_ceiling": Byte( + 0, + ), + }, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:the_nether", + ), + "id": Int( + 1, + ), + "element": Compound( + { + "has_raids": Byte( + 0, + ), + "coordinate_scale": Double( + 8.0, + ), + "piglin_safe": Byte( + 1, + ), + "monster_spawn_block_light_limit": Int( + 15, + ), + "monster_spawn_light_level": Int( + 11, + ), + "respawn_anchor_works": Byte( + 1, + ), + "effects": String( + "minecraft:the_nether", + ), + "fixed_time": Long( + 18000, + ), + "infiniburn": String( + "#minecraft:infiniburn_nether", + ), + "has_skylight": Byte( + 0, + ), + "logical_height": Int( + 128, + ), + "has_ceiling": Byte( + 1, + ), + "ambient_light": Float( + 0.1, + ), + "bed_works": Byte( + 0, + ), + "height": Int( + 256, + ), + "natural": Byte( + 0, + ), + "min_y": Int( + 0, + ), + "ultrawarm": Byte( + 1, + ), + }, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:the_end", + ), + "element": Compound( + { + "has_ceiling": Byte( + 0, + ), + "fixed_time": Long( + 6000, + ), + "effects": String( + "minecraft:the_end", + ), + "coordinate_scale": Double( + 1.0, + ), + "height": Int( + 256, + ), + "infiniburn": String( + "#minecraft:infiniburn_end", + ), + "ambient_light": Float( + 0.0, + ), + "has_skylight": Byte( + 0, + ), + "has_raids": Byte( + 1, + ), + "monster_spawn_block_light_limit": Int( + 0, + ), + "monster_spawn_light_level": Compound( + { + "value": Compound( + { + "min_inclusive": Int( + 0, + ), + "max_inclusive": Int( + 7, + ), + }, + ), + "type": String( + "minecraft:uniform", + ), + }, + ), + "piglin_safe": Byte( + 0, + ), + "natural": Byte( + 0, + ), + "respawn_anchor_works": Byte( + 0, + ), + "logical_height": Int( + 256, + ), + "ultrawarm": Byte( + 0, + ), + "min_y": Int( + 0, + ), + "bed_works": Byte( + 0, + ), + }, + ), + "id": Int( + 2, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:overworld_caves", + ), + "id": Int( + 3, + ), + "element": Compound( + { + "monster_spawn_block_light_limit": Int( + 0, + ), + "height": Int( + 384, + ), + "logical_height": Int( + 384, + ), + "min_y": Int( + -64, + ), + "has_ceiling": Byte( + 1, + ), + "effects": String( + "minecraft:overworld", + ), + "has_raids": Byte( + 1, + ), + "ambient_light": Float( + 0.0, + ), + "piglin_safe": Byte( + 0, + ), + "infiniburn": String( + "#minecraft:infiniburn_overworld", + ), + "respawn_anchor_works": Byte( + 0, + ), + "natural": Byte( + 1, + ), + "ultrawarm": Byte( + 0, + ), + "monster_spawn_light_level": Compound( + { + "type": String( + "minecraft:uniform", + ), + "value": Compound( + { + "min_inclusive": Int( + 0, + ), + "max_inclusive": Int( + 7, + ), + }, + ), + }, + ), + "has_skylight": Byte( + 1, + ), + "coordinate_scale": Double( + 1.0, + ), + "bed_works": Byte( + 1, + ), + }, + ), + }, + ), + ], + ), + }, + ), + }, + ), + }, + ), + dimension_type: minecraft:overworld, + dimension: minecraft:overworld, + seed: 3162381063931772330, + max_players: 8, + chunk_radius: 12, + simulation_distance: 8, + reduced_debug_info: false, + show_death_screen: true, + is_debug: false, + is_flat: false, + last_death_location: None, +} \ No newline at end of file From 51fbbaaf6fc8afb5ac8e13c14ad1df31b95ab64b Mon Sep 17 00:00:00 2001 From: mat Date: Thu, 26 May 2022 17:59:43 -0500 Subject: [PATCH 21/27] Compiles --- azalea-protocol/packet-macros/src/lib.rs | 2 +- .../game/clientbound_declare_commands_packet.rs | 16 ++++++++-------- .../src/packets/login/serverbound_key_packet.rs | 5 +---- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/azalea-protocol/packet-macros/src/lib.rs b/azalea-protocol/packet-macros/src/lib.rs index ae0fea0c..927e783b 100755 --- a/azalea-protocol/packet-macros/src/lib.rs +++ b/azalea-protocol/packet-macros/src/lib.rs @@ -56,7 +56,7 @@ fn create_impl_mcbufreadable(ident: &Ident, data: &Data) -> proc_macro2::TokenSt } syn::Data::Enum(syn::DataEnum { variants, .. }) => { let mut match_contents = quote!(); - let mut variant_discrim: usize = 0; + let mut variant_discrim: u32 = 0; for variant in variants { let variant_name = &variant.ident; match &variant.discriminant.as_ref() { diff --git a/azalea-protocol/src/packets/game/clientbound_declare_commands_packet.rs b/azalea-protocol/src/packets/game/clientbound_declare_commands_packet.rs index 01f633f4..5617b0c4 100755 --- a/azalea-protocol/src/packets/game/clientbound_declare_commands_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_declare_commands_packet.rs @@ -111,7 +111,7 @@ impl McBufWritable for BrigadierString { } } -#[derive(Debug, Clone, McBuf)] +#[derive(Debug, Clone, Copy, McBuf)] pub enum BrigadierParserType { Bool = 0, Double, @@ -236,13 +236,13 @@ impl McBufReadable for BrigadierParser { BrigadierParserType::String => { Ok(BrigadierParser::String(BrigadierString::read_into(buf)?)) } - BrigadierParserType::Entity { - single, - players_only, - } => Ok(BrigadierParser::Entity { - single, - players_only, - }), + BrigadierParserType::Entity => { + let flags = buf.read_byte()?; + Ok(BrigadierParser::Entity { + single: flags & 0x01 != 0, + players_only: flags & 0x02 != 0, + }) + } BrigadierParserType::GameProfile => Ok(BrigadierParser::GameProfile), BrigadierParserType::BlockPos => Ok(BrigadierParser::BlockPos), BrigadierParserType::ColumnPos => Ok(BrigadierParser::ColumnPos), diff --git a/azalea-protocol/src/packets/login/serverbound_key_packet.rs b/azalea-protocol/src/packets/login/serverbound_key_packet.rs index 2c970036..d57b122a 100644 --- a/azalea-protocol/src/packets/login/serverbound_key_packet.rs +++ b/azalea-protocol/src/packets/login/serverbound_key_packet.rs @@ -1,9 +1,6 @@ use azalea_crypto::SaltSignaturePair; use packet_macros::{LoginPacket, McBuf}; -use std::{ - hash::Hash, - io::{Read, Write}, -}; +use std::io::{Read, Write}; use crate::mc_buf::{McBufReadable, McBufWritable}; From 7c302b4b2937496bee20f7b50cb31af6cc4b4eeb Mon Sep 17 00:00:00 2001 From: mat Date: Thu, 26 May 2022 19:01:29 -0500 Subject: [PATCH 22/27] Change brigadier numbers --- .../clientbound_declare_commands_packet.rs | 226 +- login.txt | 9026 ++++++++--------- 2 files changed, 4577 insertions(+), 4675 deletions(-) diff --git a/azalea-protocol/src/packets/game/clientbound_declare_commands_packet.rs b/azalea-protocol/src/packets/game/clientbound_declare_commands_packet.rs index 5617b0c4..648ca9e0 100755 --- a/azalea-protocol/src/packets/game/clientbound_declare_commands_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_declare_commands_packet.rs @@ -1,44 +1,20 @@ use super::GamePacket; +use crate::mc_buf::McBufVarReadable; use crate::mc_buf::{McBufReadable, McBufWritable, Readable, Writable}; use azalea_core::resource_location::ResourceLocation; -use packet_macros::McBuf; +use packet_macros::{GamePacket, McBuf}; use std::{ hash::Hash, io::{Read, Write}, }; -#[derive(Hash, Clone, Debug)] +#[derive(Clone, Debug, McBuf, GamePacket)] pub struct ClientboundDeclareCommandsPacket { pub entries: Vec, + #[var] pub root_index: i32, } -impl ClientboundDeclareCommandsPacket { - pub fn get(self) -> GamePacket { - GamePacket::ClientboundDeclareCommandsPacket(self) - } - - pub fn write(&self, _buf: &mut impl Write) -> Result<(), std::io::Error> { - panic!("ClientboundDeclareCommandsPacket::write not implemented") - } - - pub fn read(buf: &mut T) -> Result { - let node_count = buf.read_varint()?; - let mut nodes = Vec::with_capacity(node_count as usize); - for _ in 0..node_count { - let node = BrigadierNodeStub::read_into(buf)?; - nodes.push(node); - } - let root_index = buf.read_varint()?; - Ok(GamePacket::ClientboundDeclareCommandsPacket( - ClientboundDeclareCommandsPacket { - entries: nodes, - root_index, - }, - )) - } -} - #[derive(Hash, Debug, Clone)] pub struct BrigadierNodeStub {} @@ -83,7 +59,7 @@ impl McBufWritable for BrigadierNumber { } } -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, McBuf)] pub enum BrigadierString { /// Reads a single word SingleWord = 0, @@ -93,76 +69,6 @@ pub enum BrigadierString { GreedyPhrase = 2, } -impl McBufReadable for BrigadierString { - fn read_into(buf: &mut impl Read) -> Result { - let id = buf.read_byte()?; - Ok(match id { - 0 => BrigadierString::SingleWord, - 1 => BrigadierString::QuotablePhrase, - 2 => BrigadierString::GreedyPhrase, - _ => panic!("Unknown BrigadierString id: {}", id), - }) - } -} -impl McBufWritable for BrigadierString { - fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { - buf.write_byte(*self as u8)?; - Ok(()) - } -} - -#[derive(Debug, Clone, Copy, McBuf)] -pub enum BrigadierParserType { - Bool = 0, - Double, - Float, - Integer, - Long, - String, - Entity, - GameProfile, - BlockPos, - ColumnPos, - Vec3, - Vec2, - BlockState, - BlockPredicate, - ItemStack, - ItemPredicate, - Color, - Component, - Message, - Nbt, - NbtPath, - Objective, - ObjectiveCriteira, - Operation, - Particle, - Rotation, - Angle, - ScoreboardSlot, - ScoreHolder, - Swizzle, - Team, - ItemSlot, - ResourceLocation, - MobEffect, - Function, - EntityAnchor, - Range, - IntRange, - FloatRange, - ItemEnchantment, - EntitySummon, - Dimension, - Uuid, - NbtTag, - NbtCompoundTag, - Time, - ResourceOrTag, - Resource, -} - #[derive(Debug, Clone)] pub enum BrigadierParser { Bool, @@ -201,7 +107,6 @@ pub enum BrigadierParser { MobEffect, Function, EntityAnchor, - Range { decimals_allowed: bool }, IntRange, FloatRange, ItemEnchantment, @@ -213,88 +118,79 @@ pub enum BrigadierParser { Time, ResourceOrTag { registry_key: ResourceLocation }, Resource { registry_key: ResourceLocation }, + TemplateMirror, + TemplateRotation, } impl McBufReadable for BrigadierParser { fn read_into(buf: &mut impl Read) -> Result { - let parser_type = BrigadierParserType::read_into(buf)?; + let parser_type = u32::var_read_into(buf)?; match parser_type { - BrigadierParserType::Bool => Ok(BrigadierParser::Bool), - BrigadierParserType::Double => { - Ok(BrigadierParser::Double(BrigadierNumber::read_into(buf)?)) - } - BrigadierParserType::Float => { - Ok(BrigadierParser::Float(BrigadierNumber::read_into(buf)?)) - } - BrigadierParserType::Integer => { - Ok(BrigadierParser::Integer(BrigadierNumber::read_into(buf)?)) - } - BrigadierParserType::Long => { - Ok(BrigadierParser::Long(BrigadierNumber::read_into(buf)?)) - } - BrigadierParserType::String => { - Ok(BrigadierParser::String(BrigadierString::read_into(buf)?)) - } - BrigadierParserType::Entity => { + 0 => Ok(BrigadierParser::Bool), + 1 => Ok(BrigadierParser::Float(BrigadierNumber::read_into(buf)?)), + 2 => Ok(BrigadierParser::Double(BrigadierNumber::read_into(buf)?)), + 3 => Ok(BrigadierParser::Integer(BrigadierNumber::read_into(buf)?)), + 4 => Ok(BrigadierParser::Long(BrigadierNumber::read_into(buf)?)), + 5 => Ok(BrigadierParser::String(BrigadierString::read_into(buf)?)), + 6 => { let flags = buf.read_byte()?; Ok(BrigadierParser::Entity { single: flags & 0x01 != 0, players_only: flags & 0x02 != 0, }) } - BrigadierParserType::GameProfile => Ok(BrigadierParser::GameProfile), - BrigadierParserType::BlockPos => Ok(BrigadierParser::BlockPos), - BrigadierParserType::ColumnPos => Ok(BrigadierParser::ColumnPos), - BrigadierParserType::Vec3 => Ok(BrigadierParser::Vec3), - BrigadierParserType::Vec2 => Ok(BrigadierParser::Vec2), - BrigadierParserType::BlockState => Ok(BrigadierParser::BlockState), - BrigadierParserType::BlockPredicate => Ok(BrigadierParser::BlockPredicate), - BrigadierParserType::ItemStack => Ok(BrigadierParser::ItemStack), - BrigadierParserType::ItemPredicate => Ok(BrigadierParser::ItemPredicate), - BrigadierParserType::Color => Ok(BrigadierParser::Color), - BrigadierParserType::Component => Ok(BrigadierParser::Component), - BrigadierParserType::Message => Ok(BrigadierParser::Message), - BrigadierParserType::Nbt => Ok(BrigadierParser::Nbt), - BrigadierParserType::NbtPath => Ok(BrigadierParser::NbtPath), - BrigadierParserType::Objective => Ok(BrigadierParser::Objective), - BrigadierParserType::ObjectiveCriteira => Ok(BrigadierParser::ObjectiveCriteira), - BrigadierParserType::Operation => Ok(BrigadierParser::Operation), - BrigadierParserType::Particle => Ok(BrigadierParser::Particle), - BrigadierParserType::Rotation => Ok(BrigadierParser::Rotation), - BrigadierParserType::Angle => Ok(BrigadierParser::Angle), - BrigadierParserType::ScoreboardSlot => Ok(BrigadierParser::ScoreboardSlot), - BrigadierParserType::ScoreHolder => { + 7 => Ok(BrigadierParser::GameProfile), + 8 => Ok(BrigadierParser::BlockPos), + 9 => Ok(BrigadierParser::ColumnPos), + 10 => Ok(BrigadierParser::Vec3), + 11 => Ok(BrigadierParser::Vec2), + 12 => Ok(BrigadierParser::BlockState), + 13 => Ok(BrigadierParser::BlockPredicate), + 14 => Ok(BrigadierParser::ItemStack), + 15 => Ok(BrigadierParser::ItemPredicate), + 16 => Ok(BrigadierParser::Color), + 17 => Ok(BrigadierParser::Component), + 18 => Ok(BrigadierParser::Message), + 19 => Ok(BrigadierParser::NbtCompoundTag), + 20 => Ok(BrigadierParser::NbtTag), + 21 => Ok(BrigadierParser::NbtPath), + 22 => Ok(BrigadierParser::Objective), + 23 => Ok(BrigadierParser::ObjectiveCriteira), + 24 => Ok(BrigadierParser::Operation), + 25 => Ok(BrigadierParser::Particle), + 26 => Ok(BrigadierParser::Angle), + 27 => Ok(BrigadierParser::Rotation), + 28 => Ok(BrigadierParser::ScoreboardSlot), + 29 => { let flags = buf.read_byte()?; Ok(BrigadierParser::ScoreHolder { allows_multiple: flags & 0x01 != 0, }) } - BrigadierParserType::Swizzle => Ok(BrigadierParser::Swizzle), - BrigadierParserType::Team => Ok(BrigadierParser::Team), - BrigadierParserType::ItemSlot => Ok(BrigadierParser::ItemSlot), - BrigadierParserType::ResourceLocation => Ok(BrigadierParser::ResourceLocation), - BrigadierParserType::MobEffect => Ok(BrigadierParser::MobEffect), - BrigadierParserType::Function => Ok(BrigadierParser::Function), - BrigadierParserType::EntityAnchor => Ok(BrigadierParser::EntityAnchor), - BrigadierParserType::Range => Ok(BrigadierParser::Range { - decimals_allowed: buf.read_boolean()?, - }), - BrigadierParserType::IntRange => Ok(BrigadierParser::IntRange), - BrigadierParserType::FloatRange => Ok(BrigadierParser::FloatRange), - BrigadierParserType::ItemEnchantment => Ok(BrigadierParser::ItemEnchantment), - BrigadierParserType::EntitySummon => Ok(BrigadierParser::EntitySummon), - BrigadierParserType::Dimension => Ok(BrigadierParser::Dimension), - BrigadierParserType::Uuid => Ok(BrigadierParser::Uuid), - BrigadierParserType::NbtTag => Ok(BrigadierParser::NbtTag), - BrigadierParserType::NbtCompoundTag => Ok(BrigadierParser::NbtCompoundTag), - BrigadierParserType::Time => Ok(BrigadierParser::Time), - BrigadierParserType::ResourceOrTag => Ok(BrigadierParser::ResourceOrTag { + 30 => Ok(BrigadierParser::Swizzle), + 31 => Ok(BrigadierParser::Team), + 32 => Ok(BrigadierParser::ItemSlot), + 33 => Ok(BrigadierParser::ResourceLocation), + 34 => Ok(BrigadierParser::MobEffect), + 35 => Ok(BrigadierParser::Function), + 36 => Ok(BrigadierParser::EntityAnchor), + 37 => Ok(BrigadierParser::IntRange), + 38 => Ok(BrigadierParser::FloatRange), + 39 => Ok(BrigadierParser::ItemEnchantment), + 40 => Ok(BrigadierParser::EntitySummon), + 41 => Ok(BrigadierParser::Dimension), + 42 => Ok(BrigadierParser::Time), + 43 => Ok(BrigadierParser::ResourceOrTag { registry_key: buf.read_resource_location()?, }), - BrigadierParserType::Resource => Ok(BrigadierParser::Resource { + 44 => Ok(BrigadierParser::Resource { registry_key: buf.read_resource_location()?, }), + 45 => Ok(BrigadierParser::TemplateMirror), + 46 => Ok(BrigadierParser::TemplateRotation), + 47 => Ok(BrigadierParser::Uuid), + _ => Err(format!("Unknown BrigadierParser type: {}", parser_type)), } } } @@ -305,7 +201,7 @@ impl McBufReadable for BrigadierNodeStub { let flags = u8::read_into(buf)?; if flags > 31 { println!( - "Warning: The flags from a Brigadier node are over 31. This is probably a bug." + "Warning: The flags from a Brigadier node are over 31 ({flags}; {flags:#b}). This is probably a bug.", ); } @@ -337,3 +233,9 @@ impl McBufReadable for BrigadierNodeStub { // return Err("Unknown node type".to_string()); } } + +impl McBufWritable for BrigadierNodeStub { + fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { + todo!() + } +} diff --git a/login.txt b/login.txt index 22a2dc6c..d196e98c 100644 --- a/login.txt +++ b/login.txt @@ -1,5 +1,5 @@ ClientboundLoginPacket { - player_id: 30321, + player_id: 41695, hardcore: false, game_type: CREATIVE, previous_game_type: None, @@ -12,11 +12,327 @@ ClientboundLoginPacket { { "": Compound( { - "minecraft:chat_type": Compound( + "minecraft:dimension_type": Compound( { "type": String( - "minecraft:chat_type", + "minecraft:dimension_type", ), + "value": List( + [ + Compound( + { + "element": Compound( + { + "has_ceiling": Byte( + 0, + ), + "bed_works": Byte( + 1, + ), + "logical_height": Int( + 384, + ), + "ambient_light": Float( + 0.0, + ), + "infiniburn": String( + "#minecraft:infiniburn_overworld", + ), + "has_raids": Byte( + 1, + ), + "piglin_safe": Byte( + 0, + ), + "coordinate_scale": Double( + 1.0, + ), + "min_y": Int( + -64, + ), + "respawn_anchor_works": Byte( + 0, + ), + "natural": Byte( + 1, + ), + "height": Int( + 384, + ), + "monster_spawn_block_light_limit": Int( + 0, + ), + "has_skylight": Byte( + 1, + ), + "ultrawarm": Byte( + 0, + ), + "effects": String( + "minecraft:overworld", + ), + "monster_spawn_light_level": Compound( + { + "type": String( + "minecraft:uniform", + ), + "value": Compound( + { + "max_inclusive": Int( + 7, + ), + "min_inclusive": Int( + 0, + ), + }, + ), + }, + ), + }, + ), + "id": Int( + 0, + ), + "name": String( + "minecraft:overworld", + ), + }, + ), + Compound( + { + "element": Compound( + { + "fixed_time": Long( + 18000, + ), + "height": Int( + 256, + ), + "coordinate_scale": Double( + 8.0, + ), + "bed_works": Byte( + 0, + ), + "ambient_light": Float( + 0.1, + ), + "monster_spawn_light_level": Int( + 11, + ), + "respawn_anchor_works": Byte( + 1, + ), + "effects": String( + "minecraft:the_nether", + ), + "min_y": Int( + 0, + ), + "natural": Byte( + 0, + ), + "has_ceiling": Byte( + 1, + ), + "has_raids": Byte( + 0, + ), + "logical_height": Int( + 128, + ), + "piglin_safe": Byte( + 1, + ), + "monster_spawn_block_light_limit": Int( + 15, + ), + "infiniburn": String( + "#minecraft:infiniburn_nether", + ), + "has_skylight": Byte( + 0, + ), + "ultrawarm": Byte( + 1, + ), + }, + ), + "name": String( + "minecraft:the_nether", + ), + "id": Int( + 1, + ), + }, + ), + Compound( + { + "id": Int( + 2, + ), + "element": Compound( + { + "monster_spawn_light_level": Compound( + { + "type": String( + "minecraft:uniform", + ), + "value": Compound( + { + "min_inclusive": Int( + 0, + ), + "max_inclusive": Int( + 7, + ), + }, + ), + }, + ), + "min_y": Int( + 0, + ), + "natural": Byte( + 0, + ), + "logical_height": Int( + 256, + ), + "has_raids": Byte( + 1, + ), + "monster_spawn_block_light_limit": Int( + 0, + ), + "ambient_light": Float( + 0.0, + ), + "infiniburn": String( + "#minecraft:infiniburn_end", + ), + "ultrawarm": Byte( + 0, + ), + "has_ceiling": Byte( + 0, + ), + "has_skylight": Byte( + 0, + ), + "fixed_time": Long( + 6000, + ), + "piglin_safe": Byte( + 0, + ), + "bed_works": Byte( + 0, + ), + "effects": String( + "minecraft:the_end", + ), + "respawn_anchor_works": Byte( + 0, + ), + "coordinate_scale": Double( + 1.0, + ), + "height": Int( + 256, + ), + }, + ), + "name": String( + "minecraft:the_end", + ), + }, + ), + Compound( + { + "id": Int( + 3, + ), + "name": String( + "minecraft:overworld_caves", + ), + "element": Compound( + { + "effects": String( + "minecraft:overworld", + ), + "bed_works": Byte( + 1, + ), + "ultrawarm": Byte( + 0, + ), + "respawn_anchor_works": Byte( + 0, + ), + "monster_spawn_block_light_limit": Int( + 0, + ), + "has_raids": Byte( + 1, + ), + "ambient_light": Float( + 0.0, + ), + "infiniburn": String( + "#minecraft:infiniburn_overworld", + ), + "logical_height": Int( + 384, + ), + "min_y": Int( + -64, + ), + "height": Int( + 384, + ), + "monster_spawn_light_level": Compound( + { + "value": Compound( + { + "min_inclusive": Int( + 0, + ), + "max_inclusive": Int( + 7, + ), + }, + ), + "type": String( + "minecraft:uniform", + ), + }, + ), + "piglin_safe": Byte( + 0, + ), + "has_skylight": Byte( + 1, + ), + "has_ceiling": Byte( + 1, + ), + "coordinate_scale": Double( + 1.0, + ), + "natural": Byte( + 1, + ), + }, + ), + }, + ), + ], + ), + }, + ), + "minecraft:worldgen/biome": Compound( + { "value": List( [ Compound( @@ -24,9 +340,4061 @@ ClientboundLoginPacket { "id": Int( 0, ), + "element": Compound( + { + "downfall": Float( + 0.5, + ), + "temperature": Float( + 0.5, + ), + "effects": Compound( + { + "fog_color": Int( + 12638463, + ), + "sky_color": Int( + 8103167, + ), + "water_color": Int( + 4159204, + ), + "water_fog_color": Int( + 329011, + ), + "mood_sound": Compound( + { + "offset": Double( + 2.0, + ), + "block_search_extent": Int( + 8, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "tick_delay": Int( + 6000, + ), + }, + ), + }, + ), + "precipitation": String( + "none", + ), + }, + ), + "name": String( + "minecraft:the_void", + ), + }, + ), + Compound( + { + "name": String( + "minecraft:plains", + ), + "element": Compound( + { + "temperature": Float( + 0.8, + ), + "downfall": Float( + 0.4, + ), + "effects": Compound( + { + "sky_color": Int( + 7907327, + ), + "fog_color": Int( + 12638463, + ), + "water_fog_color": Int( + 329011, + ), + "water_color": Int( + 4159204, + ), + "mood_sound": Compound( + { + "sound": String( + "minecraft:ambient.cave", + ), + "tick_delay": Int( + 6000, + ), + "block_search_extent": Int( + 8, + ), + "offset": Double( + 2.0, + ), + }, + ), + }, + ), + "precipitation": String( + "rain", + ), + }, + ), + "id": Int( + 1, + ), + }, + ), + Compound( + { + "id": Int( + 2, + ), + "name": String( + "minecraft:sunflower_plains", + ), + "element": Compound( + { + "precipitation": String( + "rain", + ), + "effects": Compound( + { + "sky_color": Int( + 7907327, + ), + "water_fog_color": Int( + 329011, + ), + "water_color": Int( + 4159204, + ), + "fog_color": Int( + 12638463, + ), + "mood_sound": Compound( + { + "offset": Double( + 2.0, + ), + "tick_delay": Int( + 6000, + ), + "block_search_extent": Int( + 8, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + }, + ), + "downfall": Float( + 0.4, + ), + "temperature": Float( + 0.8, + ), + }, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:snowy_plains", + ), + "id": Int( + 3, + ), + "element": Compound( + { + "precipitation": String( + "snow", + ), + "effects": Compound( + { + "water_fog_color": Int( + 329011, + ), + "fog_color": Int( + 12638463, + ), + "sky_color": Int( + 8364543, + ), + "water_color": Int( + 4159204, + ), + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "block_search_extent": Int( + 8, + ), + }, + ), + }, + ), + "temperature": Float( + 0.0, + ), + "downfall": Float( + 0.5, + ), + }, + ), + }, + ), + Compound( + { + "id": Int( + 4, + ), + "name": String( + "minecraft:ice_spikes", + ), + "element": Compound( + { + "downfall": Float( + 0.5, + ), + "temperature": Float( + 0.0, + ), + "precipitation": String( + "snow", + ), + "effects": Compound( + { + "water_fog_color": Int( + 329011, + ), + "sky_color": Int( + 8364543, + ), + "fog_color": Int( + 12638463, + ), + "water_color": Int( + 4159204, + ), + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "block_search_extent": Int( + 8, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + }, + ), + }, + ), + }, + ), + Compound( + { + "element": Compound( + { + "temperature": Float( + 2.0, + ), + "effects": Compound( + { + "mood_sound": Compound( + { + "sound": String( + "minecraft:ambient.cave", + ), + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "block_search_extent": Int( + 8, + ), + }, + ), + "water_color": Int( + 4159204, + ), + "sky_color": Int( + 7254527, + ), + "fog_color": Int( + 12638463, + ), + "water_fog_color": Int( + 329011, + ), + }, + ), + "downfall": Float( + 0.0, + ), + "precipitation": String( + "none", + ), + }, + ), + "id": Int( + 5, + ), + "name": String( + "minecraft:desert", + ), + }, + ), + Compound( + { + "element": Compound( + { + "temperature": Float( + 0.8, + ), + "downfall": Float( + 0.9, + ), + "effects": Compound( + { + "foliage_color": Int( + 6975545, + ), + "water_color": Int( + 6388580, + ), + "music": Compound( + { + "replace_current_music": Byte( + 0, + ), + "max_delay": Int( + 24000, + ), + "min_delay": Int( + 12000, + ), + "sound": String( + "minecraft:music.overworld.swamp", + ), + }, + ), + "fog_color": Int( + 12638463, + ), + "grass_color_modifier": String( + "swamp", + ), + "mood_sound": Compound( + { + "offset": Double( + 2.0, + ), + "block_search_extent": Int( + 8, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "tick_delay": Int( + 6000, + ), + }, + ), + "sky_color": Int( + 7907327, + ), + "water_fog_color": Int( + 2302743, + ), + }, + ), + "precipitation": String( + "rain", + ), + }, + ), + "name": String( + "minecraft:swamp", + ), + "id": Int( + 6, + ), + }, + ), + Compound( + { + "id": Int( + 7, + ), + "name": String( + "minecraft:mangrove_swamp", + ), + "element": Compound( + { + "downfall": Float( + 0.9, + ), + "temperature": Float( + 0.8, + ), + "effects": Compound( + { + "foliage_color": Int( + 9285927, + ), + "grass_color_modifier": String( + "swamp", + ), + "water_color": Int( + 3832426, + ), + "sky_color": Int( + 7907327, + ), + "music": Compound( + { + "replace_current_music": Byte( + 0, + ), + "max_delay": Int( + 24000, + ), + "sound": String( + "minecraft:music.overworld.swamp", + ), + "min_delay": Int( + 12000, + ), + }, + ), + "fog_color": Int( + 12638463, + ), + "water_fog_color": Int( + 5077600, + ), + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "block_search_extent": Int( + 8, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + }, + ), + "precipitation": String( + "rain", + ), + }, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:forest", + ), + "element": Compound( + { + "temperature": Float( + 0.7, + ), + "downfall": Float( + 0.8, + ), + "precipitation": String( + "rain", + ), + "effects": Compound( + { + "water_fog_color": Int( + 329011, + ), + "water_color": Int( + 4159204, + ), + "fog_color": Int( + 12638463, + ), + "mood_sound": Compound( + { + "block_search_extent": Int( + 8, + ), + "offset": Double( + 2.0, + ), + "tick_delay": Int( + 6000, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + "sky_color": Int( + 7972607, + ), + "music": Compound( + { + "sound": String( + "minecraft:music.overworld.jungle_and_forest", + ), + "replace_current_music": Byte( + 0, + ), + "max_delay": Int( + 24000, + ), + "min_delay": Int( + 12000, + ), + }, + ), + }, + ), + }, + ), + "id": Int( + 8, + ), + }, + ), + Compound( + { + "element": Compound( + { + "downfall": Float( + 0.8, + ), + "temperature": Float( + 0.7, + ), + "effects": Compound( + { + "water_color": Int( + 4159204, + ), + "mood_sound": Compound( + { + "block_search_extent": Int( + 8, + ), + "offset": Double( + 2.0, + ), + "tick_delay": Int( + 6000, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + "water_fog_color": Int( + 329011, + ), + "sky_color": Int( + 7972607, + ), + "music": Compound( + { + "max_delay": Int( + 24000, + ), + "min_delay": Int( + 12000, + ), + "replace_current_music": Byte( + 0, + ), + "sound": String( + "minecraft:music.overworld.jungle_and_forest", + ), + }, + ), + "fog_color": Int( + 12638463, + ), + }, + ), + "precipitation": String( + "rain", + ), + }, + ), + "name": String( + "minecraft:flower_forest", + ), + "id": Int( + 9, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:birch_forest", + ), + "element": Compound( + { + "precipitation": String( + "rain", + ), + "downfall": Float( + 0.6, + ), + "effects": Compound( + { + "fog_color": Int( + 12638463, + ), + "sky_color": Int( + 8037887, + ), + "water_fog_color": Int( + 329011, + ), + "music": Compound( + { + "min_delay": Int( + 12000, + ), + "max_delay": Int( + 24000, + ), + "replace_current_music": Byte( + 0, + ), + "sound": String( + "minecraft:music.overworld.jungle_and_forest", + ), + }, + ), + "water_color": Int( + 4159204, + ), + "mood_sound": Compound( + { + "offset": Double( + 2.0, + ), + "block_search_extent": Int( + 8, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "tick_delay": Int( + 6000, + ), + }, + ), + }, + ), + "temperature": Float( + 0.6, + ), + }, + ), + "id": Int( + 10, + ), + }, + ), + Compound( + { + "element": Compound( + { + "effects": Compound( + { + "water_color": Int( + 4159204, + ), + "fog_color": Int( + 12638463, + ), + "music": Compound( + { + "max_delay": Int( + 24000, + ), + "replace_current_music": Byte( + 0, + ), + "min_delay": Int( + 12000, + ), + "sound": String( + "minecraft:music.overworld.jungle_and_forest", + ), + }, + ), + "sky_color": Int( + 7972607, + ), + "water_fog_color": Int( + 329011, + ), + "mood_sound": Compound( + { + "sound": String( + "minecraft:ambient.cave", + ), + "offset": Double( + 2.0, + ), + "tick_delay": Int( + 6000, + ), + "block_search_extent": Int( + 8, + ), + }, + ), + "grass_color_modifier": String( + "dark_forest", + ), + }, + ), + "precipitation": String( + "rain", + ), + "temperature": Float( + 0.7, + ), + "downfall": Float( + 0.8, + ), + }, + ), + "name": String( + "minecraft:dark_forest", + ), + "id": Int( + 11, + ), + }, + ), + Compound( + { + "id": Int( + 12, + ), + "name": String( + "minecraft:old_growth_birch_forest", + ), + "element": Compound( + { + "precipitation": String( + "rain", + ), + "temperature": Float( + 0.6, + ), + "downfall": Float( + 0.6, + ), + "effects": Compound( + { + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "block_search_extent": Int( + 8, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + "music": Compound( + { + "min_delay": Int( + 12000, + ), + "sound": String( + "minecraft:music.overworld.jungle_and_forest", + ), + "replace_current_music": Byte( + 0, + ), + "max_delay": Int( + 24000, + ), + }, + ), + "water_color": Int( + 4159204, + ), + "sky_color": Int( + 8037887, + ), + "fog_color": Int( + 12638463, + ), + "water_fog_color": Int( + 329011, + ), + }, + ), + }, + ), + }, + ), + Compound( + { + "id": Int( + 13, + ), + "name": String( + "minecraft:old_growth_pine_taiga", + ), + "element": Compound( + { + "temperature": Float( + 0.3, + ), + "precipitation": String( + "rain", + ), + "effects": Compound( + { + "water_fog_color": Int( + 329011, + ), + "fog_color": Int( + 12638463, + ), + "sky_color": Int( + 8168447, + ), + "music": Compound( + { + "min_delay": Int( + 12000, + ), + "replace_current_music": Byte( + 0, + ), + "max_delay": Int( + 24000, + ), + "sound": String( + "minecraft:music.overworld.old_growth_taiga", + ), + }, + ), + "water_color": Int( + 4159204, + ), + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "block_search_extent": Int( + 8, + ), + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + }, + ), + "downfall": Float( + 0.8, + ), + }, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:old_growth_spruce_taiga", + ), + "element": Compound( + { + "precipitation": String( + "rain", + ), + "effects": Compound( + { + "fog_color": Int( + 12638463, + ), + "mood_sound": Compound( + { + "sound": String( + "minecraft:ambient.cave", + ), + "offset": Double( + 2.0, + ), + "tick_delay": Int( + 6000, + ), + "block_search_extent": Int( + 8, + ), + }, + ), + "water_fog_color": Int( + 329011, + ), + "music": Compound( + { + "replace_current_music": Byte( + 0, + ), + "sound": String( + "minecraft:music.overworld.old_growth_taiga", + ), + "min_delay": Int( + 12000, + ), + "max_delay": Int( + 24000, + ), + }, + ), + "water_color": Int( + 4159204, + ), + "sky_color": Int( + 8233983, + ), + }, + ), + "temperature": Float( + 0.25, + ), + "downfall": Float( + 0.8, + ), + }, + ), + "id": Int( + 14, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:taiga", + ), + "id": Int( + 15, + ), + "element": Compound( + { + "temperature": Float( + 0.25, + ), + "downfall": Float( + 0.8, + ), + "precipitation": String( + "rain", + ), + "effects": Compound( + { + "water_color": Int( + 4159204, + ), + "water_fog_color": Int( + 329011, + ), + "fog_color": Int( + 12638463, + ), + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "block_search_extent": Int( + 8, + ), + }, + ), + "sky_color": Int( + 8233983, + ), + }, + ), + }, + ), + }, + ), + Compound( + { + "element": Compound( + { + "temperature": Float( + -0.5, + ), + "downfall": Float( + 0.4, + ), + "precipitation": String( + "snow", + ), + "effects": Compound( + { + "mood_sound": Compound( + { + "offset": Double( + 2.0, + ), + "block_search_extent": Int( + 8, + ), + "tick_delay": Int( + 6000, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + "water_color": Int( + 4020182, + ), + "sky_color": Int( + 8625919, + ), + "fog_color": Int( + 12638463, + ), + "water_fog_color": Int( + 329011, + ), + }, + ), + }, + ), + "id": Int( + 16, + ), + "name": String( + "minecraft:snowy_taiga", + ), + }, + ), + Compound( + { + "name": String( + "minecraft:savanna", + ), + "id": Int( + 17, + ), + "element": Compound( + { + "precipitation": String( + "none", + ), + "effects": Compound( + { + "water_color": Int( + 4159204, + ), + "fog_color": Int( + 12638463, + ), + "mood_sound": Compound( + { + "offset": Double( + 2.0, + ), + "tick_delay": Int( + 6000, + ), + "block_search_extent": Int( + 8, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + "sky_color": Int( + 7254527, + ), + "water_fog_color": Int( + 329011, + ), + }, + ), + "temperature": Float( + 2.0, + ), + "downfall": Float( + 0.0, + ), + }, + ), + }, + ), + Compound( + { + "element": Compound( + { + "precipitation": String( + "none", + ), + "downfall": Float( + 0.0, + ), + "temperature": Float( + 2.0, + ), + "effects": Compound( + { + "water_fog_color": Int( + 329011, + ), + "fog_color": Int( + 12638463, + ), + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "block_search_extent": Int( + 8, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + "water_color": Int( + 4159204, + ), + "sky_color": Int( + 7254527, + ), + }, + ), + }, + ), + "name": String( + "minecraft:savanna_plateau", + ), + "id": Int( + 18, + ), + }, + ), + Compound( + { + "element": Compound( + { + "temperature": Float( + 0.2, + ), + "effects": Compound( + { + "water_fog_color": Int( + 329011, + ), + "fog_color": Int( + 12638463, + ), + "water_color": Int( + 4159204, + ), + "sky_color": Int( + 8233727, + ), + "mood_sound": Compound( + { + "block_search_extent": Int( + 8, + ), + "offset": Double( + 2.0, + ), + "tick_delay": Int( + 6000, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + }, + ), + "downfall": Float( + 0.3, + ), + "precipitation": String( + "rain", + ), + }, + ), + "name": String( + "minecraft:windswept_hills", + ), + "id": Int( + 19, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:windswept_gravelly_hills", + ), + "id": Int( + 20, + ), + "element": Compound( + { + "precipitation": String( + "rain", + ), + "temperature": Float( + 0.2, + ), + "effects": Compound( + { + "water_fog_color": Int( + 329011, + ), + "fog_color": Int( + 12638463, + ), + "sky_color": Int( + 8233727, + ), + "water_color": Int( + 4159204, + ), + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "block_search_extent": Int( + 8, + ), + }, + ), + }, + ), + "downfall": Float( + 0.3, + ), + }, + ), + }, + ), + Compound( + { + "element": Compound( + { + "downfall": Float( + 0.3, + ), + "effects": Compound( + { + "water_color": Int( + 4159204, + ), + "water_fog_color": Int( + 329011, + ), + "sky_color": Int( + 8233727, + ), + "fog_color": Int( + 12638463, + ), + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "block_search_extent": Int( + 8, + ), + "offset": Double( + 2.0, + ), + }, + ), + }, + ), + "precipitation": String( + "rain", + ), + "temperature": Float( + 0.2, + ), + }, + ), + "id": Int( + 21, + ), + "name": String( + "minecraft:windswept_forest", + ), + }, + ), + Compound( + { + "id": Int( + 22, + ), + "name": String( + "minecraft:windswept_savanna", + ), + "element": Compound( + { + "precipitation": String( + "none", + ), + "effects": Compound( + { + "sky_color": Int( + 7254527, + ), + "fog_color": Int( + 12638463, + ), + "water_fog_color": Int( + 329011, + ), + "water_color": Int( + 4159204, + ), + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "block_search_extent": Int( + 8, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + }, + ), + "temperature": Float( + 2.0, + ), + "downfall": Float( + 0.0, + ), + }, + ), + }, + ), + Compound( + { + "id": Int( + 23, + ), + "name": String( + "minecraft:jungle", + ), + "element": Compound( + { + "downfall": Float( + 0.9, + ), + "precipitation": String( + "rain", + ), + "effects": Compound( + { + "water_fog_color": Int( + 329011, + ), + "water_color": Int( + 4159204, + ), + "music": Compound( + { + "sound": String( + "minecraft:music.overworld.jungle_and_forest", + ), + "max_delay": Int( + 24000, + ), + "replace_current_music": Byte( + 0, + ), + "min_delay": Int( + 12000, + ), + }, + ), + "sky_color": Int( + 7842047, + ), + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "block_search_extent": Int( + 8, + ), + }, + ), + "fog_color": Int( + 12638463, + ), + }, + ), + "temperature": Float( + 0.95, + ), + }, + ), + }, + ), + Compound( + { + "element": Compound( + { + "effects": Compound( + { + "mood_sound": Compound( + { + "offset": Double( + 2.0, + ), + "tick_delay": Int( + 6000, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "block_search_extent": Int( + 8, + ), + }, + ), + "music": Compound( + { + "replace_current_music": Byte( + 0, + ), + "max_delay": Int( + 24000, + ), + "min_delay": Int( + 12000, + ), + "sound": String( + "minecraft:music.overworld.jungle_and_forest", + ), + }, + ), + "water_fog_color": Int( + 329011, + ), + "sky_color": Int( + 7842047, + ), + "fog_color": Int( + 12638463, + ), + "water_color": Int( + 4159204, + ), + }, + ), + "downfall": Float( + 0.8, + ), + "temperature": Float( + 0.95, + ), + "precipitation": String( + "rain", + ), + }, + ), + "name": String( + "minecraft:sparse_jungle", + ), + "id": Int( + 24, + ), + }, + ), + Compound( + { + "element": Compound( + { + "downfall": Float( + 0.9, + ), + "temperature": Float( + 0.95, + ), + "effects": Compound( + { + "music": Compound( + { + "sound": String( + "minecraft:music.overworld.jungle_and_forest", + ), + "min_delay": Int( + 12000, + ), + "replace_current_music": Byte( + 0, + ), + "max_delay": Int( + 24000, + ), + }, + ), + "fog_color": Int( + 12638463, + ), + "mood_sound": Compound( + { + "sound": String( + "minecraft:ambient.cave", + ), + "offset": Double( + 2.0, + ), + "tick_delay": Int( + 6000, + ), + "block_search_extent": Int( + 8, + ), + }, + ), + "sky_color": Int( + 7842047, + ), + "water_fog_color": Int( + 329011, + ), + "water_color": Int( + 4159204, + ), + }, + ), + "precipitation": String( + "rain", + ), + }, + ), + "name": String( + "minecraft:bamboo_jungle", + ), + "id": Int( + 25, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:badlands", + ), + "id": Int( + 26, + ), + "element": Compound( + { + "temperature": Float( + 2.0, + ), + "downfall": Float( + 0.0, + ), + "precipitation": String( + "none", + ), + "effects": Compound( + { + "water_color": Int( + 4159204, + ), + "foliage_color": Int( + 10387789, + ), + "grass_color": Int( + 9470285, + ), + "fog_color": Int( + 12638463, + ), + "water_fog_color": Int( + 329011, + ), + "mood_sound": Compound( + { + "sound": String( + "minecraft:ambient.cave", + ), + "tick_delay": Int( + 6000, + ), + "block_search_extent": Int( + 8, + ), + "offset": Double( + 2.0, + ), + }, + ), + "sky_color": Int( + 7254527, + ), + }, + ), + }, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:eroded_badlands", + ), + "id": Int( + 27, + ), + "element": Compound( + { + "precipitation": String( + "none", + ), + "downfall": Float( + 0.0, + ), + "effects": Compound( + { + "foliage_color": Int( + 10387789, + ), + "sky_color": Int( + 7254527, + ), + "water_color": Int( + 4159204, + ), + "water_fog_color": Int( + 329011, + ), + "grass_color": Int( + 9470285, + ), + "mood_sound": Compound( + { + "block_search_extent": Int( + 8, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "offset": Double( + 2.0, + ), + "tick_delay": Int( + 6000, + ), + }, + ), + "fog_color": Int( + 12638463, + ), + }, + ), + "temperature": Float( + 2.0, + ), + }, + ), + }, + ), + Compound( + { + "id": Int( + 28, + ), + "element": Compound( + { + "temperature": Float( + 2.0, + ), + "downfall": Float( + 0.0, + ), + "precipitation": String( + "none", + ), + "effects": Compound( + { + "sky_color": Int( + 7254527, + ), + "grass_color": Int( + 9470285, + ), + "water_fog_color": Int( + 329011, + ), + "mood_sound": Compound( + { + "sound": String( + "minecraft:ambient.cave", + ), + "offset": Double( + 2.0, + ), + "block_search_extent": Int( + 8, + ), + "tick_delay": Int( + 6000, + ), + }, + ), + "water_color": Int( + 4159204, + ), + "fog_color": Int( + 12638463, + ), + "foliage_color": Int( + 10387789, + ), + }, + ), + }, + ), + "name": String( + "minecraft:wooded_badlands", + ), + }, + ), + Compound( + { + "name": String( + "minecraft:meadow", + ), + "id": Int( + 29, + ), + "element": Compound( + { + "temperature": Float( + 0.5, + ), + "precipitation": String( + "rain", + ), + "downfall": Float( + 0.8, + ), + "effects": Compound( + { + "water_color": Int( + 937679, + ), + "water_fog_color": Int( + 329011, + ), + "music": Compound( + { + "replace_current_music": Byte( + 0, + ), + "min_delay": Int( + 12000, + ), + "sound": String( + "minecraft:music.overworld.meadow", + ), + "max_delay": Int( + 24000, + ), + }, + ), + "sky_color": Int( + 8103167, + ), + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "block_search_extent": Int( + 8, + ), + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + "fog_color": Int( + 12638463, + ), + }, + ), + }, + ), + }, + ), + Compound( + { + "element": Compound( + { + "precipitation": String( + "snow", + ), + "temperature": Float( + -0.2, + ), + "effects": Compound( + { + "water_color": Int( + 4159204, + ), + "mood_sound": Compound( + { + "offset": Double( + 2.0, + ), + "block_search_extent": Int( + 8, + ), + "tick_delay": Int( + 6000, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + "sky_color": Int( + 8495359, + ), + "music": Compound( + { + "max_delay": Int( + 24000, + ), + "min_delay": Int( + 12000, + ), + "sound": String( + "minecraft:music.overworld.grove", + ), + "replace_current_music": Byte( + 0, + ), + }, + ), + "fog_color": Int( + 12638463, + ), + "water_fog_color": Int( + 329011, + ), + }, + ), + "downfall": Float( + 0.8, + ), + }, + ), + "name": String( + "minecraft:grove", + ), + "id": Int( + 30, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:snowy_slopes", + ), + "element": Compound( + { + "temperature": Float( + -0.3, + ), + "downfall": Float( + 0.9, + ), + "precipitation": String( + "snow", + ), + "effects": Compound( + { + "water_fog_color": Int( + 329011, + ), + "fog_color": Int( + 12638463, + ), + "music": Compound( + { + "max_delay": Int( + 24000, + ), + "sound": String( + "minecraft:music.overworld.snowy_slopes", + ), + "min_delay": Int( + 12000, + ), + "replace_current_music": Byte( + 0, + ), + }, + ), + "sky_color": Int( + 8560639, + ), + "water_color": Int( + 4159204, + ), + "mood_sound": Compound( + { + "block_search_extent": Int( + 8, + ), + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + }, + ), + }, + ), + "id": Int( + 31, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:frozen_peaks", + ), + "element": Compound( + { + "effects": Compound( + { + "music": Compound( + { + "replace_current_music": Byte( + 0, + ), + "max_delay": Int( + 24000, + ), + "min_delay": Int( + 12000, + ), + "sound": String( + "minecraft:music.overworld.frozen_peaks", + ), + }, + ), + "fog_color": Int( + 12638463, + ), + "sky_color": Int( + 8756735, + ), + "water_fog_color": Int( + 329011, + ), + "water_color": Int( + 4159204, + ), + "mood_sound": Compound( + { + "sound": String( + "minecraft:ambient.cave", + ), + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "block_search_extent": Int( + 8, + ), + }, + ), + }, + ), + "temperature": Float( + -0.7, + ), + "precipitation": String( + "snow", + ), + "downfall": Float( + 0.9, + ), + }, + ), + "id": Int( + 32, + ), + }, + ), + Compound( + { + "element": Compound( + { + "temperature": Float( + -0.7, + ), + "downfall": Float( + 0.9, + ), + "effects": Compound( + { + "mood_sound": Compound( + { + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "tick_delay": Int( + 6000, + ), + "block_search_extent": Int( + 8, + ), + }, + ), + "fog_color": Int( + 12638463, + ), + "music": Compound( + { + "min_delay": Int( + 12000, + ), + "max_delay": Int( + 24000, + ), + "sound": String( + "minecraft:music.overworld.jagged_peaks", + ), + "replace_current_music": Byte( + 0, + ), + }, + ), + "water_color": Int( + 4159204, + ), + "sky_color": Int( + 8756735, + ), + "water_fog_color": Int( + 329011, + ), + }, + ), + "precipitation": String( + "snow", + ), + }, + ), + "id": Int( + 33, + ), + "name": String( + "minecraft:jagged_peaks", + ), + }, + ), + Compound( + { + "element": Compound( + { + "downfall": Float( + 0.3, + ), + "effects": Compound( + { + "music": Compound( + { + "min_delay": Int( + 12000, + ), + "replace_current_music": Byte( + 0, + ), + "sound": String( + "minecraft:music.overworld.stony_peaks", + ), + "max_delay": Int( + 24000, + ), + }, + ), + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "block_search_extent": Int( + 8, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + "sky_color": Int( + 7776511, + ), + "water_color": Int( + 4159204, + ), + "fog_color": Int( + 12638463, + ), + "water_fog_color": Int( + 329011, + ), + }, + ), + "temperature": Float( + 1.0, + ), + "precipitation": String( + "rain", + ), + }, + ), + "name": String( + "minecraft:stony_peaks", + ), + "id": Int( + 34, + ), + }, + ), + Compound( + { + "id": Int( + 35, + ), + "element": Compound( + { + "effects": Compound( + { + "sky_color": Int( + 8103167, + ), + "fog_color": Int( + 12638463, + ), + "water_color": Int( + 4159204, + ), + "water_fog_color": Int( + 329011, + ), + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "block_search_extent": Int( + 8, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "offset": Double( + 2.0, + ), + }, + ), + }, + ), + "temperature": Float( + 0.5, + ), + "precipitation": String( + "rain", + ), + "downfall": Float( + 0.5, + ), + }, + ), + "name": String( + "minecraft:river", + ), + }, + ), + Compound( + { + "id": Int( + 36, + ), + "element": Compound( + { + "downfall": Float( + 0.5, + ), + "temperature": Float( + 0.0, + ), + "precipitation": String( + "snow", + ), + "effects": Compound( + { + "water_fog_color": Int( + 329011, + ), + "water_color": Int( + 3750089, + ), + "mood_sound": Compound( + { + "offset": Double( + 2.0, + ), + "block_search_extent": Int( + 8, + ), + "tick_delay": Int( + 6000, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + "fog_color": Int( + 12638463, + ), + "sky_color": Int( + 8364543, + ), + }, + ), + }, + ), + "name": String( + "minecraft:frozen_river", + ), + }, + ), + Compound( + { + "element": Compound( + { + "downfall": Float( + 0.4, + ), + "precipitation": String( + "rain", + ), + "effects": Compound( + { + "mood_sound": Compound( + { + "sound": String( + "minecraft:ambient.cave", + ), + "block_search_extent": Int( + 8, + ), + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + }, + ), + "sky_color": Int( + 7907327, + ), + "water_color": Int( + 4159204, + ), + "water_fog_color": Int( + 329011, + ), + "fog_color": Int( + 12638463, + ), + }, + ), + "temperature": Float( + 0.8, + ), + }, + ), + "name": String( + "minecraft:beach", + ), + "id": Int( + 37, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:snowy_beach", + ), + "element": Compound( + { + "effects": Compound( + { + "sky_color": Int( + 8364543, + ), + "fog_color": Int( + 12638463, + ), + "mood_sound": Compound( + { + "block_search_extent": Int( + 8, + ), + "offset": Double( + 2.0, + ), + "tick_delay": Int( + 6000, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + "water_fog_color": Int( + 329011, + ), + "water_color": Int( + 4020182, + ), + }, + ), + "downfall": Float( + 0.3, + ), + "precipitation": String( + "snow", + ), + "temperature": Float( + 0.05, + ), + }, + ), + "id": Int( + 38, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:stony_shore", + ), + "id": Int( + 39, + ), + "element": Compound( + { + "precipitation": String( + "rain", + ), + "temperature": Float( + 0.2, + ), + "effects": Compound( + { + "water_fog_color": Int( + 329011, + ), + "fog_color": Int( + 12638463, + ), + "mood_sound": Compound( + { + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "block_search_extent": Int( + 8, + ), + "tick_delay": Int( + 6000, + ), + }, + ), + "sky_color": Int( + 8233727, + ), + "water_color": Int( + 4159204, + ), + }, + ), + "downfall": Float( + 0.3, + ), + }, + ), + }, + ), + Compound( + { + "id": Int( + 40, + ), + "name": String( + "minecraft:warm_ocean", + ), + "element": Compound( + { + "temperature": Float( + 0.5, + ), + "effects": Compound( + { + "sky_color": Int( + 8103167, + ), + "water_color": Int( + 4445678, + ), + "water_fog_color": Int( + 270131, + ), + "mood_sound": Compound( + { + "sound": String( + "minecraft:ambient.cave", + ), + "block_search_extent": Int( + 8, + ), + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + }, + ), + "fog_color": Int( + 12638463, + ), + }, + ), + "precipitation": String( + "rain", + ), + "downfall": Float( + 0.5, + ), + }, + ), + }, + ), + Compound( + { + "element": Compound( + { + "temperature": Float( + 0.5, + ), + "downfall": Float( + 0.5, + ), + "precipitation": String( + "rain", + ), + "effects": Compound( + { + "water_fog_color": Int( + 267827, + ), + "sky_color": Int( + 8103167, + ), + "fog_color": Int( + 12638463, + ), + "water_color": Int( + 4566514, + ), + "mood_sound": Compound( + { + "block_search_extent": Int( + 8, + ), + "tick_delay": Int( + 6000, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "offset": Double( + 2.0, + ), + }, + ), + }, + ), + }, + ), + "name": String( + "minecraft:lukewarm_ocean", + ), + "id": Int( + 41, + ), + }, + ), + Compound( + { + "element": Compound( + { + "effects": Compound( + { + "fog_color": Int( + 12638463, + ), + "sky_color": Int( + 8103167, + ), + "water_color": Int( + 4566514, + ), + "water_fog_color": Int( + 267827, + ), + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "block_search_extent": Int( + 8, + ), + "offset": Double( + 2.0, + ), + }, + ), + }, + ), + "precipitation": String( + "rain", + ), + "temperature": Float( + 0.5, + ), + "downfall": Float( + 0.5, + ), + }, + ), + "id": Int( + 42, + ), + "name": String( + "minecraft:deep_lukewarm_ocean", + ), + }, + ), + Compound( + { + "name": String( + "minecraft:ocean", + ), + "id": Int( + 43, + ), + "element": Compound( + { + "downfall": Float( + 0.5, + ), + "effects": Compound( + { + "water_color": Int( + 4159204, + ), + "sky_color": Int( + 8103167, + ), + "mood_sound": Compound( + { + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "block_search_extent": Int( + 8, + ), + "tick_delay": Int( + 6000, + ), + }, + ), + "water_fog_color": Int( + 329011, + ), + "fog_color": Int( + 12638463, + ), + }, + ), + "precipitation": String( + "rain", + ), + "temperature": Float( + 0.5, + ), + }, + ), + }, + ), + Compound( + { + "id": Int( + 44, + ), + "name": String( + "minecraft:deep_ocean", + ), + "element": Compound( + { + "effects": Compound( + { + "fog_color": Int( + 12638463, + ), + "water_color": Int( + 4159204, + ), + "sky_color": Int( + 8103167, + ), + "mood_sound": Compound( + { + "block_search_extent": Int( + 8, + ), + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + "water_fog_color": Int( + 329011, + ), + }, + ), + "precipitation": String( + "rain", + ), + "temperature": Float( + 0.5, + ), + "downfall": Float( + 0.5, + ), + }, + ), + }, + ), + Compound( + { + "element": Compound( + { + "precipitation": String( + "rain", + ), + "effects": Compound( + { + "water_color": Int( + 4020182, + ), + "fog_color": Int( + 12638463, + ), + "sky_color": Int( + 8103167, + ), + "water_fog_color": Int( + 329011, + ), + "mood_sound": Compound( + { + "sound": String( + "minecraft:ambient.cave", + ), + "offset": Double( + 2.0, + ), + "block_search_extent": Int( + 8, + ), + "tick_delay": Int( + 6000, + ), + }, + ), + }, + ), + "temperature": Float( + 0.5, + ), + "downfall": Float( + 0.5, + ), + }, + ), + "name": String( + "minecraft:cold_ocean", + ), + "id": Int( + 45, + ), + }, + ), + Compound( + { + "id": Int( + 46, + ), + "name": String( + "minecraft:deep_cold_ocean", + ), + "element": Compound( + { + "downfall": Float( + 0.5, + ), + "precipitation": String( + "rain", + ), + "effects": Compound( + { + "water_fog_color": Int( + 329011, + ), + "fog_color": Int( + 12638463, + ), + "sky_color": Int( + 8103167, + ), + "mood_sound": Compound( + { + "block_search_extent": Int( + 8, + ), + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + "water_color": Int( + 4020182, + ), + }, + ), + "temperature": Float( + 0.5, + ), + }, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:frozen_ocean", + ), + "id": Int( + 47, + ), + "element": Compound( + { + "temperature_modifier": String( + "frozen", + ), + "precipitation": String( + "snow", + ), + "effects": Compound( + { + "sky_color": Int( + 8364543, + ), + "fog_color": Int( + 12638463, + ), + "water_fog_color": Int( + 329011, + ), + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "block_search_extent": Int( + 8, + ), + }, + ), + "water_color": Int( + 3750089, + ), + }, + ), + "temperature": Float( + 0.0, + ), + "downfall": Float( + 0.5, + ), + }, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:deep_frozen_ocean", + ), + "element": Compound( + { + "downfall": Float( + 0.5, + ), + "effects": Compound( + { + "fog_color": Int( + 12638463, + ), + "water_color": Int( + 3750089, + ), + "sky_color": Int( + 8103167, + ), + "water_fog_color": Int( + 329011, + ), + "mood_sound": Compound( + { + "block_search_extent": Int( + 8, + ), + "tick_delay": Int( + 6000, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "offset": Double( + 2.0, + ), + }, + ), + }, + ), + "temperature_modifier": String( + "frozen", + ), + "temperature": Float( + 0.5, + ), + "precipitation": String( + "rain", + ), + }, + ), + "id": Int( + 48, + ), + }, + ), + Compound( + { + "element": Compound( + { + "precipitation": String( + "rain", + ), + "effects": Compound( + { + "mood_sound": Compound( + { + "sound": String( + "minecraft:ambient.cave", + ), + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "block_search_extent": Int( + 8, + ), + }, + ), + "sky_color": Int( + 7842047, + ), + "fog_color": Int( + 12638463, + ), + "water_color": Int( + 4159204, + ), + "water_fog_color": Int( + 329011, + ), + }, + ), + "downfall": Float( + 1.0, + ), + "temperature": Float( + 0.9, + ), + }, + ), + "name": String( + "minecraft:mushroom_fields", + ), + "id": Int( + 49, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:dripstone_caves", + ), + "id": Int( + 50, + ), + "element": Compound( + { + "downfall": Float( + 0.4, + ), + "precipitation": String( + "rain", + ), + "effects": Compound( + { + "fog_color": Int( + 12638463, + ), + "sky_color": Int( + 7907327, + ), + "mood_sound": Compound( + { + "block_search_extent": Int( + 8, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "offset": Double( + 2.0, + ), + "tick_delay": Int( + 6000, + ), + }, + ), + "water_fog_color": Int( + 329011, + ), + "music": Compound( + { + "sound": String( + "minecraft:music.overworld.dripstone_caves", + ), + "replace_current_music": Byte( + 0, + ), + "max_delay": Int( + 24000, + ), + "min_delay": Int( + 12000, + ), + }, + ), + "water_color": Int( + 4159204, + ), + }, + ), + "temperature": Float( + 0.8, + ), + }, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:lush_caves", + ), + "element": Compound( + { + "precipitation": String( + "rain", + ), + "effects": Compound( + { + "water_fog_color": Int( + 329011, + ), + "fog_color": Int( + 12638463, + ), + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "block_search_extent": Int( + 8, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + "water_color": Int( + 4159204, + ), + "sky_color": Int( + 8103167, + ), + "music": Compound( + { + "min_delay": Int( + 12000, + ), + "sound": String( + "minecraft:music.overworld.lush_caves", + ), + "replace_current_music": Byte( + 0, + ), + "max_delay": Int( + 24000, + ), + }, + ), + }, + ), + "temperature": Float( + 0.5, + ), + "downfall": Float( + 0.5, + ), + }, + ), + "id": Int( + 51, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:deep_dark", + ), + "id": Int( + 52, + ), + "element": Compound( + { + "effects": Compound( + { + "sky_color": Int( + 7907327, + ), + "mood_sound": Compound( + { + "offset": Double( + 2.0, + ), + "tick_delay": Int( + 6000, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "block_search_extent": Int( + 8, + ), + }, + ), + "music": Compound( + { + "max_delay": Int( + 24000, + ), + "replace_current_music": Byte( + 0, + ), + "sound": String( + "minecraft:music.overworld.deep_dark", + ), + "min_delay": Int( + 12000, + ), + }, + ), + "water_color": Int( + 4159204, + ), + "water_fog_color": Int( + 329011, + ), + "fog_color": Int( + 12638463, + ), + }, + ), + "downfall": Float( + 0.4, + ), + "precipitation": String( + "rain", + ), + "temperature": Float( + 0.8, + ), + }, + ), + }, + ), + Compound( + { + "id": Int( + 53, + ), + "name": String( + "minecraft:nether_wastes", + ), + "element": Compound( + { + "temperature": Float( + 2.0, + ), + "precipitation": String( + "none", + ), + "downfall": Float( + 0.0, + ), + "effects": Compound( + { + "mood_sound": Compound( + { + "sound": String( + "minecraft:ambient.nether_wastes.mood", + ), + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "block_search_extent": Int( + 8, + ), + }, + ), + "water_fog_color": Int( + 329011, + ), + "water_color": Int( + 4159204, + ), + "fog_color": Int( + 3344392, + ), + "music": Compound( + { + "min_delay": Int( + 12000, + ), + "max_delay": Int( + 24000, + ), + "sound": String( + "minecraft:music.nether.nether_wastes", + ), + "replace_current_music": Byte( + 0, + ), + }, + ), + "sky_color": Int( + 7254527, + ), + "ambient_sound": String( + "minecraft:ambient.nether_wastes.loop", + ), + "additions_sound": Compound( + { + "tick_chance": Double( + 0.0111, + ), + "sound": String( + "minecraft:ambient.nether_wastes.additions", + ), + }, + ), + }, + ), + }, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:warped_forest", + ), + "element": Compound( + { + "temperature": Float( + 2.0, + ), + "precipitation": String( + "none", + ), + "effects": Compound( + { + "additions_sound": Compound( + { + "tick_chance": Double( + 0.0111, + ), + "sound": String( + "minecraft:ambient.warped_forest.additions", + ), + }, + ), + "fog_color": Int( + 1705242, + ), + "music": Compound( + { + "replace_current_music": Byte( + 0, + ), + "max_delay": Int( + 24000, + ), + "min_delay": Int( + 12000, + ), + "sound": String( + "minecraft:music.nether.warped_forest", + ), + }, + ), + "ambient_sound": String( + "minecraft:ambient.warped_forest.loop", + ), + "particle": Compound( + { + "options": Compound( + { + "type": String( + "minecraft:warped_spore", + ), + }, + ), + "probability": Float( + 0.01428, + ), + }, + ), + "water_fog_color": Int( + 329011, + ), + "mood_sound": Compound( + { + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.warped_forest.mood", + ), + "tick_delay": Int( + 6000, + ), + "block_search_extent": Int( + 8, + ), + }, + ), + "sky_color": Int( + 7254527, + ), + "water_color": Int( + 4159204, + ), + }, + ), + "downfall": Float( + 0.0, + ), + }, + ), + "id": Int( + 54, + ), + }, + ), + Compound( + { + "id": Int( + 55, + ), + "name": String( + "minecraft:crimson_forest", + ), + "element": Compound( + { + "temperature": Float( + 2.0, + ), + "precipitation": String( + "none", + ), + "effects": Compound( + { + "additions_sound": Compound( + { + "tick_chance": Double( + 0.0111, + ), + "sound": String( + "minecraft:ambient.crimson_forest.additions", + ), + }, + ), + "particle": Compound( + { + "options": Compound( + { + "type": String( + "minecraft:crimson_spore", + ), + }, + ), + "probability": Float( + 0.025, + ), + }, + ), + "water_fog_color": Int( + 329011, + ), + "music": Compound( + { + "sound": String( + "minecraft:music.nether.crimson_forest", + ), + "min_delay": Int( + 12000, + ), + "replace_current_music": Byte( + 0, + ), + "max_delay": Int( + 24000, + ), + }, + ), + "fog_color": Int( + 3343107, + ), + "sky_color": Int( + 7254527, + ), + "ambient_sound": String( + "minecraft:ambient.crimson_forest.loop", + ), + "water_color": Int( + 4159204, + ), + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.crimson_forest.mood", + ), + "block_search_extent": Int( + 8, + ), + }, + ), + }, + ), + "downfall": Float( + 0.0, + ), + }, + ), + }, + ), + Compound( + { + "id": Int( + 56, + ), + "name": String( + "minecraft:soul_sand_valley", + ), + "element": Compound( + { + "effects": Compound( + { + "fog_color": Int( + 1787717, + ), + "water_color": Int( + 4159204, + ), + "mood_sound": Compound( + { + "sound": String( + "minecraft:ambient.soul_sand_valley.mood", + ), + "block_search_extent": Int( + 8, + ), + "offset": Double( + 2.0, + ), + "tick_delay": Int( + 6000, + ), + }, + ), + "additions_sound": Compound( + { + "sound": String( + "minecraft:ambient.soul_sand_valley.additions", + ), + "tick_chance": Double( + 0.0111, + ), + }, + ), + "ambient_sound": String( + "minecraft:ambient.soul_sand_valley.loop", + ), + "music": Compound( + { + "sound": String( + "minecraft:music.nether.soul_sand_valley", + ), + "min_delay": Int( + 12000, + ), + "replace_current_music": Byte( + 0, + ), + "max_delay": Int( + 24000, + ), + }, + ), + "water_fog_color": Int( + 329011, + ), + "particle": Compound( + { + "probability": Float( + 0.00625, + ), + "options": Compound( + { + "type": String( + "minecraft:ash", + ), + }, + ), + }, + ), + "sky_color": Int( + 7254527, + ), + }, + ), + "downfall": Float( + 0.0, + ), + "temperature": Float( + 2.0, + ), + "precipitation": String( + "none", + ), + }, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:basalt_deltas", + ), + "id": Int( + 57, + ), + "element": Compound( + { + "downfall": Float( + 0.0, + ), + "temperature": Float( + 2.0, + ), + "precipitation": String( + "none", + ), + "effects": Compound( + { + "fog_color": Int( + 6840176, + ), + "mood_sound": Compound( + { + "sound": String( + "minecraft:ambient.basalt_deltas.mood", + ), + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "block_search_extent": Int( + 8, + ), + }, + ), + "ambient_sound": String( + "minecraft:ambient.basalt_deltas.loop", + ), + "water_fog_color": Int( + 329011, + ), + "sky_color": Int( + 7254527, + ), + "particle": Compound( + { + "options": Compound( + { + "type": String( + "minecraft:white_ash", + ), + }, + ), + "probability": Float( + 0.118093334, + ), + }, + ), + "music": Compound( + { + "sound": String( + "minecraft:music.nether.basalt_deltas", + ), + "min_delay": Int( + 12000, + ), + "replace_current_music": Byte( + 0, + ), + "max_delay": Int( + 24000, + ), + }, + ), + "water_color": Int( + 4159204, + ), + "additions_sound": Compound( + { + "tick_chance": Double( + 0.0111, + ), + "sound": String( + "minecraft:ambient.basalt_deltas.additions", + ), + }, + ), + }, + ), + }, + ), + }, + ), + Compound( + { + "element": Compound( + { + "effects": Compound( + { + "sky_color": Int( + 0, + ), + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "block_search_extent": Int( + 8, + ), + }, + ), + "water_fog_color": Int( + 329011, + ), + "water_color": Int( + 4159204, + ), + "fog_color": Int( + 10518688, + ), + }, + ), + "temperature": Float( + 0.5, + ), + "precipitation": String( + "none", + ), + "downfall": Float( + 0.5, + ), + }, + ), + "id": Int( + 58, + ), + "name": String( + "minecraft:the_end", + ), + }, + ), + Compound( + { + "element": Compound( + { + "effects": Compound( + { + "fog_color": Int( + 10518688, + ), + "water_color": Int( + 4159204, + ), + "mood_sound": Compound( + { + "block_search_extent": Int( + 8, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + }, + ), + "water_fog_color": Int( + 329011, + ), + "sky_color": Int( + 0, + ), + }, + ), + "downfall": Float( + 0.5, + ), + "temperature": Float( + 0.5, + ), + "precipitation": String( + "none", + ), + }, + ), + "name": String( + "minecraft:end_highlands", + ), + "id": Int( + 59, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:end_midlands", + ), + "element": Compound( + { + "temperature": Float( + 0.5, + ), + "precipitation": String( + "none", + ), + "effects": Compound( + { + "water_fog_color": Int( + 329011, + ), + "water_color": Int( + 4159204, + ), + "fog_color": Int( + 10518688, + ), + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "block_search_extent": Int( + 8, + ), + "offset": Double( + 2.0, + ), + }, + ), + "sky_color": Int( + 0, + ), + }, + ), + "downfall": Float( + 0.5, + ), + }, + ), + "id": Int( + 60, + ), + }, + ), + Compound( + { + "name": String( + "minecraft:small_end_islands", + ), + "id": Int( + 61, + ), + "element": Compound( + { + "effects": Compound( + { + "water_color": Int( + 4159204, + ), + "sky_color": Int( + 0, + ), + "fog_color": Int( + 10518688, + ), + "water_fog_color": Int( + 329011, + ), + "mood_sound": Compound( + { + "block_search_extent": Int( + 8, + ), + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.cave", + ), + }, + ), + }, + ), + "precipitation": String( + "none", + ), + "downfall": Float( + 0.5, + ), + "temperature": Float( + 0.5, + ), + }, + ), + }, + ), + Compound( + { + "element": Compound( + { + "temperature": Float( + 0.5, + ), + "precipitation": String( + "none", + ), + "effects": Compound( + { + "sky_color": Int( + 0, + ), + "water_fog_color": Int( + 329011, + ), + "fog_color": Int( + 10518688, + ), + "water_color": Int( + 4159204, + ), + "mood_sound": Compound( + { + "tick_delay": Int( + 6000, + ), + "offset": Double( + 2.0, + ), + "sound": String( + "minecraft:ambient.cave", + ), + "block_search_extent": Int( + 8, + ), + }, + ), + }, + ), + "downfall": Float( + 0.5, + ), + }, + ), + "name": String( + "minecraft:end_barrens", + ), + "id": Int( + 62, + ), + }, + ), + ], + ), + "type": String( + "minecraft:worldgen/biome", + ), + }, + ), + "minecraft:chat_type": Compound( + { + "value": List( + [ + Compound( + { "name": String( "minecraft:chat", ), + "id": Int( + 0, + ), "element": Compound( { "chat": Compound( @@ -60,9 +4428,6 @@ ClientboundLoginPacket { ), "decoration": Compound( { - "translation_key": String( - "chat.type.text.narrate", - ), "parameters": List( [ String( @@ -73,6 +4438,9 @@ ClientboundLoginPacket { ), ], ), + "translation_key": String( + "chat.type.text.narrate", + ), "style": Compound( {}, ), @@ -86,17 +4454,14 @@ ClientboundLoginPacket { ), Compound( { - "name": String( - "minecraft:system", - ), "id": Int( 1, ), + "name": String( + "minecraft:system", + ), "element": Compound( { - "chat": Compound( - {}, - ), "narration": Compound( { "priority": String( @@ -104,6 +4469,9 @@ ClientboundLoginPacket { ), }, ), + "chat": Compound( + {}, + ), }, ), }, @@ -127,9 +4495,6 @@ ClientboundLoginPacket { ), Compound( { - "id": Int( - 3, - ), "element": Compound( { "chat": Compound( @@ -139,6 +4504,9 @@ ClientboundLoginPacket { "translation_key": String( "chat.type.announcement", ), + "style": Compound( + {}, + ), "parameters": List( [ String( @@ -149,26 +4517,20 @@ ClientboundLoginPacket { ), ], ), - "style": Compound( - {}, - ), }, ), }, ), "narration": Compound( { - "priority": String( - "chat", - ), "decoration": Compound( { - "translation_key": String( - "chat.type.text.narrate", - ), "style": Compound( {}, ), + "translation_key": String( + "chat.type.text.narrate", + ), "parameters": List( [ String( @@ -181,6 +4543,9 @@ ClientboundLoginPacket { ), }, ), + "priority": String( + "chat", + ), }, ), }, @@ -188,10 +4553,16 @@ ClientboundLoginPacket { "name": String( "minecraft:say_command", ), + "id": Int( + 3, + ), }, ), Compound( { + "name": String( + "minecraft:msg_command", + ), "id": Int( 4, ), @@ -201,6 +4572,16 @@ ClientboundLoginPacket { { "decoration": Compound( { + "style": Compound( + { + "italic": Byte( + 1, + ), + "color": String( + "gray", + ), + }, + ), "parameters": List( [ String( @@ -214,25 +4595,12 @@ ClientboundLoginPacket { "translation_key": String( "commands.message.display.incoming", ), - "style": Compound( - { - "italic": Byte( - 1, - ), - "color": String( - "gray", - ), - }, - ), }, ), }, ), "narration": Compound( { - "priority": String( - "chat", - ), "decoration": Compound( { "parameters": List( @@ -245,66 +4613,33 @@ ClientboundLoginPacket { ), ], ), - "style": Compound( - {}, - ), "translation_key": String( "chat.type.text.narrate", ), + "style": Compound( + {}, + ), }, ), + "priority": String( + "chat", + ), }, ), }, ), - "name": String( - "minecraft:msg_command", - ), }, ), Compound( { - "id": Int( - 5, - ), - "name": String( - "minecraft:team_msg_command", - ), "element": Compound( { - "narration": Compound( - { - "decoration": Compound( - { - "parameters": List( - [ - String( - "sender", - ), - String( - "content", - ), - ], - ), - "style": Compound( - {}, - ), - "translation_key": String( - "chat.type.text.narrate", - ), - }, - ), - "priority": String( - "chat", - ), - }, - ), "chat": Compound( { "decoration": Compound( { - "style": Compound( - {}, + "translation_key": String( + "chat.type.team.text", ), "parameters": List( [ @@ -319,8 +4654,100 @@ ClientboundLoginPacket { ), ], ), + "style": Compound( + {}, + ), + }, + ), + }, + ), + "narration": Compound( + { + "decoration": Compound( + { + "style": Compound( + {}, + ), "translation_key": String( - "chat.type.team.text", + "chat.type.text.narrate", + ), + "parameters": List( + [ + String( + "sender", + ), + String( + "content", + ), + ], + ), + }, + ), + "priority": String( + "chat", + ), + }, + ), + }, + ), + "id": Int( + 5, + ), + "name": String( + "minecraft:team_msg_command", + ), + }, + ), + Compound( + { + "element": Compound( + { + "chat": Compound( + { + "decoration": Compound( + { + "parameters": List( + [ + String( + "sender", + ), + String( + "content", + ), + ], + ), + "translation_key": String( + "chat.type.emote", + ), + "style": Compound( + {}, + ), + }, + ), + }, + ), + "narration": Compound( + { + "priority": String( + "chat", + ), + "decoration": Compound( + { + "style": Compound( + {}, + ), + "translation_key": String( + "chat.type.emote", + ), + "parameters": List( + [ + String( + "sender", + ), + String( + "content", + ), + ], ), }, ), @@ -328,77 +4755,24 @@ ClientboundLoginPacket { ), }, ), - }, - ), - Compound( - { "name": String( "minecraft:emote_command", ), "id": Int( 6, ), - "element": Compound( - { - "narration": Compound( - { - "decoration": Compound( - { - "parameters": List( - [ - String( - "sender", - ), - String( - "content", - ), - ], - ), - "style": Compound( - {}, - ), - "translation_key": String( - "chat.type.emote", - ), - }, - ), - "priority": String( - "chat", - ), - }, - ), - "chat": Compound( - { - "decoration": Compound( - { - "translation_key": String( - "chat.type.emote", - ), - "parameters": List( - [ - String( - "sender", - ), - String( - "content", - ), - ], - ), - "style": Compound( - {}, - ), - }, - ), - }, - ), - }, - ), }, ), Compound( { + "id": Int( + 7, + ), "element": Compound( { + "chat": Compound( + {}, + ), "narration": Compound( { "priority": String( @@ -406,4391 +4780,17 @@ ClientboundLoginPacket { ), }, ), - "chat": Compound( - {}, - ), }, ), "name": String( "minecraft:tellraw_command", ), - "id": Int( - 7, - ), }, ), ], ), - }, - ), - "minecraft:worldgen/biome": Compound( - { "type": String( - "minecraft:worldgen/biome", - ), - "value": List( - [ - Compound( - { - "element": Compound( - { - "precipitation": String( - "none", - ), - "temperature": Float( - 0.5, - ), - "effects": Compound( - { - "mood_sound": Compound( - { - "sound": String( - "minecraft:ambient.cave", - ), - "offset": Double( - 2.0, - ), - "block_search_extent": Int( - 8, - ), - "tick_delay": Int( - 6000, - ), - }, - ), - "water_fog_color": Int( - 329011, - ), - "sky_color": Int( - 8103167, - ), - "water_color": Int( - 4159204, - ), - "fog_color": Int( - 12638463, - ), - }, - ), - "downfall": Float( - 0.5, - ), - }, - ), - "id": Int( - 0, - ), - "name": String( - "minecraft:the_void", - ), - }, - ), - Compound( - { - "element": Compound( - { - "precipitation": String( - "rain", - ), - "temperature": Float( - 0.8, - ), - "downfall": Float( - 0.4, - ), - "effects": Compound( - { - "water_color": Int( - 4159204, - ), - "water_fog_color": Int( - 329011, - ), - "sky_color": Int( - 7907327, - ), - "fog_color": Int( - 12638463, - ), - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "block_search_extent": Int( - 8, - ), - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - }, - ), - }, - ), - "name": String( - "minecraft:plains", - ), - "id": Int( - 1, - ), - }, - ), - Compound( - { - "id": Int( - 2, - ), - "name": String( - "minecraft:sunflower_plains", - ), - "element": Compound( - { - "downfall": Float( - 0.4, - ), - "effects": Compound( - { - "water_fog_color": Int( - 329011, - ), - "mood_sound": Compound( - { - "offset": Double( - 2.0, - ), - "block_search_extent": Int( - 8, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "tick_delay": Int( - 6000, - ), - }, - ), - "fog_color": Int( - 12638463, - ), - "water_color": Int( - 4159204, - ), - "sky_color": Int( - 7907327, - ), - }, - ), - "precipitation": String( - "rain", - ), - "temperature": Float( - 0.8, - ), - }, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:snowy_plains", - ), - "element": Compound( - { - "downfall": Float( - 0.5, - ), - "temperature": Float( - 0.0, - ), - "effects": Compound( - { - "water_color": Int( - 4159204, - ), - "water_fog_color": Int( - 329011, - ), - "sky_color": Int( - 8364543, - ), - "fog_color": Int( - 12638463, - ), - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "block_search_extent": Int( - 8, - ), - }, - ), - }, - ), - "precipitation": String( - "snow", - ), - }, - ), - "id": Int( - 3, - ), - }, - ), - Compound( - { - "id": Int( - 4, - ), - "element": Compound( - { - "precipitation": String( - "snow", - ), - "effects": Compound( - { - "water_fog_color": Int( - 329011, - ), - "sky_color": Int( - 8364543, - ), - "fog_color": Int( - 12638463, - ), - "mood_sound": Compound( - { - "sound": String( - "minecraft:ambient.cave", - ), - "block_search_extent": Int( - 8, - ), - "offset": Double( - 2.0, - ), - "tick_delay": Int( - 6000, - ), - }, - ), - "water_color": Int( - 4159204, - ), - }, - ), - "downfall": Float( - 0.5, - ), - "temperature": Float( - 0.0, - ), - }, - ), - "name": String( - "minecraft:ice_spikes", - ), - }, - ), - Compound( - { - "name": String( - "minecraft:desert", - ), - "id": Int( - 5, - ), - "element": Compound( - { - "effects": Compound( - { - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "block_search_extent": Int( - 8, - ), - }, - ), - "sky_color": Int( - 7254527, - ), - "water_color": Int( - 4159204, - ), - "water_fog_color": Int( - 329011, - ), - "fog_color": Int( - 12638463, - ), - }, - ), - "temperature": Float( - 2.0, - ), - "precipitation": String( - "none", - ), - "downfall": Float( - 0.0, - ), - }, - ), - }, - ), - Compound( - { - "element": Compound( - { - "effects": Compound( - { - "water_fog_color": Int( - 2302743, - ), - "music": Compound( - { - "replace_current_music": Byte( - 0, - ), - "max_delay": Int( - 24000, - ), - "sound": String( - "minecraft:music.overworld.swamp", - ), - "min_delay": Int( - 12000, - ), - }, - ), - "fog_color": Int( - 12638463, - ), - "water_color": Int( - 6388580, - ), - "sky_color": Int( - 7907327, - ), - "mood_sound": Compound( - { - "sound": String( - "minecraft:ambient.cave", - ), - "block_search_extent": Int( - 8, - ), - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - }, - ), - "foliage_color": Int( - 6975545, - ), - "grass_color_modifier": String( - "swamp", - ), - }, - ), - "temperature": Float( - 0.8, - ), - "precipitation": String( - "rain", - ), - "downfall": Float( - 0.9, - ), - }, - ), - "name": String( - "minecraft:swamp", - ), - "id": Int( - 6, - ), - }, - ), - Compound( - { - "id": Int( - 7, - ), - "name": String( - "minecraft:mangrove_swamp", - ), - "element": Compound( - { - "effects": Compound( - { - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "block_search_extent": Int( - 8, - ), - }, - ), - "foliage_color": Int( - 9285927, - ), - "fog_color": Int( - 12638463, - ), - "music": Compound( - { - "sound": String( - "minecraft:music.overworld.swamp", - ), - "replace_current_music": Byte( - 0, - ), - "max_delay": Int( - 24000, - ), - "min_delay": Int( - 12000, - ), - }, - ), - "grass_color_modifier": String( - "swamp", - ), - "water_color": Int( - 3832426, - ), - "water_fog_color": Int( - 5077600, - ), - "sky_color": Int( - 7907327, - ), - }, - ), - "temperature": Float( - 0.8, - ), - "precipitation": String( - "rain", - ), - "downfall": Float( - 0.9, - ), - }, - ), - }, - ), - Compound( - { - "id": Int( - 8, - ), - "name": String( - "minecraft:forest", - ), - "element": Compound( - { - "temperature": Float( - 0.7, - ), - "effects": Compound( - { - "water_fog_color": Int( - 329011, - ), - "fog_color": Int( - 12638463, - ), - "mood_sound": Compound( - { - "block_search_extent": Int( - 8, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - }, - ), - "sky_color": Int( - 7972607, - ), - "water_color": Int( - 4159204, - ), - "music": Compound( - { - "replace_current_music": Byte( - 0, - ), - "min_delay": Int( - 12000, - ), - "sound": String( - "minecraft:music.overworld.jungle_and_forest", - ), - "max_delay": Int( - 24000, - ), - }, - ), - }, - ), - "precipitation": String( - "rain", - ), - "downfall": Float( - 0.8, - ), - }, - ), - }, - ), - Compound( - { - "element": Compound( - { - "temperature": Float( - 0.7, - ), - "effects": Compound( - { - "water_color": Int( - 4159204, - ), - "sky_color": Int( - 7972607, - ), - "water_fog_color": Int( - 329011, - ), - "fog_color": Int( - 12638463, - ), - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "block_search_extent": Int( - 8, - ), - }, - ), - "music": Compound( - { - "max_delay": Int( - 24000, - ), - "sound": String( - "minecraft:music.overworld.jungle_and_forest", - ), - "min_delay": Int( - 12000, - ), - "replace_current_music": Byte( - 0, - ), - }, - ), - }, - ), - "precipitation": String( - "rain", - ), - "downfall": Float( - 0.8, - ), - }, - ), - "name": String( - "minecraft:flower_forest", - ), - "id": Int( - 9, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:birch_forest", - ), - "id": Int( - 10, - ), - "element": Compound( - { - "precipitation": String( - "rain", - ), - "temperature": Float( - 0.6, - ), - "downfall": Float( - 0.6, - ), - "effects": Compound( - { - "fog_color": Int( - 12638463, - ), - "water_color": Int( - 4159204, - ), - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "block_search_extent": Int( - 8, - ), - }, - ), - "sky_color": Int( - 8037887, - ), - "water_fog_color": Int( - 329011, - ), - "music": Compound( - { - "min_delay": Int( - 12000, - ), - "sound": String( - "minecraft:music.overworld.jungle_and_forest", - ), - "replace_current_music": Byte( - 0, - ), - "max_delay": Int( - 24000, - ), - }, - ), - }, - ), - }, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:dark_forest", - ), - "id": Int( - 11, - ), - "element": Compound( - { - "downfall": Float( - 0.8, - ), - "precipitation": String( - "rain", - ), - "temperature": Float( - 0.7, - ), - "effects": Compound( - { - "sky_color": Int( - 7972607, - ), - "water_fog_color": Int( - 329011, - ), - "fog_color": Int( - 12638463, - ), - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "block_search_extent": Int( - 8, - ), - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - "grass_color_modifier": String( - "dark_forest", - ), - "water_color": Int( - 4159204, - ), - "music": Compound( - { - "min_delay": Int( - 12000, - ), - "replace_current_music": Byte( - 0, - ), - "max_delay": Int( - 24000, - ), - "sound": String( - "minecraft:music.overworld.jungle_and_forest", - ), - }, - ), - }, - ), - }, - ), - }, - ), - Compound( - { - "element": Compound( - { - "downfall": Float( - 0.6, - ), - "effects": Compound( - { - "sky_color": Int( - 8037887, - ), - "music": Compound( - { - "min_delay": Int( - 12000, - ), - "replace_current_music": Byte( - 0, - ), - "sound": String( - "minecraft:music.overworld.jungle_and_forest", - ), - "max_delay": Int( - 24000, - ), - }, - ), - "water_fog_color": Int( - 329011, - ), - "fog_color": Int( - 12638463, - ), - "water_color": Int( - 4159204, - ), - "mood_sound": Compound( - { - "block_search_extent": Int( - 8, - ), - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - }, - ), - "precipitation": String( - "rain", - ), - "temperature": Float( - 0.6, - ), - }, - ), - "name": String( - "minecraft:old_growth_birch_forest", - ), - "id": Int( - 12, - ), - }, - ), - Compound( - { - "element": Compound( - { - "precipitation": String( - "rain", - ), - "effects": Compound( - { - "music": Compound( - { - "min_delay": Int( - 12000, - ), - "max_delay": Int( - 24000, - ), - "sound": String( - "minecraft:music.overworld.old_growth_taiga", - ), - "replace_current_music": Byte( - 0, - ), - }, - ), - "water_fog_color": Int( - 329011, - ), - "water_color": Int( - 4159204, - ), - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "block_search_extent": Int( - 8, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "offset": Double( - 2.0, - ), - }, - ), - "fog_color": Int( - 12638463, - ), - "sky_color": Int( - 8168447, - ), - }, - ), - "temperature": Float( - 0.3, - ), - "downfall": Float( - 0.8, - ), - }, - ), - "id": Int( - 13, - ), - "name": String( - "minecraft:old_growth_pine_taiga", - ), - }, - ), - Compound( - { - "name": String( - "minecraft:old_growth_spruce_taiga", - ), - "element": Compound( - { - "precipitation": String( - "rain", - ), - "downfall": Float( - 0.8, - ), - "temperature": Float( - 0.25, - ), - "effects": Compound( - { - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "block_search_extent": Int( - 8, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - "sky_color": Int( - 8233983, - ), - "music": Compound( - { - "max_delay": Int( - 24000, - ), - "sound": String( - "minecraft:music.overworld.old_growth_taiga", - ), - "min_delay": Int( - 12000, - ), - "replace_current_music": Byte( - 0, - ), - }, - ), - "water_fog_color": Int( - 329011, - ), - "fog_color": Int( - 12638463, - ), - "water_color": Int( - 4159204, - ), - }, - ), - }, - ), - "id": Int( - 14, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:taiga", - ), - "id": Int( - 15, - ), - "element": Compound( - { - "downfall": Float( - 0.8, - ), - "precipitation": String( - "rain", - ), - "effects": Compound( - { - "water_fog_color": Int( - 329011, - ), - "water_color": Int( - 4159204, - ), - "sky_color": Int( - 8233983, - ), - "fog_color": Int( - 12638463, - ), - "mood_sound": Compound( - { - "block_search_extent": Int( - 8, - ), - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - }, - ), - "temperature": Float( - 0.25, - ), - }, - ), - }, - ), - Compound( - { - "element": Compound( - { - "precipitation": String( - "snow", - ), - "temperature": Float( - -0.5, - ), - "effects": Compound( - { - "water_color": Int( - 4020182, - ), - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "block_search_extent": Int( - 8, - ), - }, - ), - "water_fog_color": Int( - 329011, - ), - "sky_color": Int( - 8625919, - ), - "fog_color": Int( - 12638463, - ), - }, - ), - "downfall": Float( - 0.4, - ), - }, - ), - "name": String( - "minecraft:snowy_taiga", - ), - "id": Int( - 16, - ), - }, - ), - Compound( - { - "element": Compound( - { - "effects": Compound( - { - "sky_color": Int( - 7254527, - ), - "water_fog_color": Int( - 329011, - ), - "fog_color": Int( - 12638463, - ), - "water_color": Int( - 4159204, - ), - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "block_search_extent": Int( - 8, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - }, - ), - "precipitation": String( - "none", - ), - "downfall": Float( - 0.0, - ), - "temperature": Float( - 2.0, - ), - }, - ), - "name": String( - "minecraft:savanna", - ), - "id": Int( - 17, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:savanna_plateau", - ), - "element": Compound( - { - "precipitation": String( - "none", - ), - "effects": Compound( - { - "water_fog_color": Int( - 329011, - ), - "sky_color": Int( - 7254527, - ), - "fog_color": Int( - 12638463, - ), - "mood_sound": Compound( - { - "offset": Double( - 2.0, - ), - "block_search_extent": Int( - 8, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "tick_delay": Int( - 6000, - ), - }, - ), - "water_color": Int( - 4159204, - ), - }, - ), - "temperature": Float( - 2.0, - ), - "downfall": Float( - 0.0, - ), - }, - ), - "id": Int( - 18, - ), - }, - ), - Compound( - { - "element": Compound( - { - "effects": Compound( - { - "water_fog_color": Int( - 329011, - ), - "water_color": Int( - 4159204, - ), - "mood_sound": Compound( - { - "sound": String( - "minecraft:ambient.cave", - ), - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "block_search_extent": Int( - 8, - ), - }, - ), - "sky_color": Int( - 8233727, - ), - "fog_color": Int( - 12638463, - ), - }, - ), - "downfall": Float( - 0.3, - ), - "precipitation": String( - "rain", - ), - "temperature": Float( - 0.2, - ), - }, - ), - "id": Int( - 19, - ), - "name": String( - "minecraft:windswept_hills", - ), - }, - ), - Compound( - { - "id": Int( - 20, - ), - "element": Compound( - { - "effects": Compound( - { - "fog_color": Int( - 12638463, - ), - "mood_sound": Compound( - { - "block_search_extent": Int( - 8, - ), - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "tick_delay": Int( - 6000, - ), - }, - ), - "water_fog_color": Int( - 329011, - ), - "sky_color": Int( - 8233727, - ), - "water_color": Int( - 4159204, - ), - }, - ), - "temperature": Float( - 0.2, - ), - "downfall": Float( - 0.3, - ), - "precipitation": String( - "rain", - ), - }, - ), - "name": String( - "minecraft:windswept_gravelly_hills", - ), - }, - ), - Compound( - { - "element": Compound( - { - "temperature": Float( - 0.2, - ), - "downfall": Float( - 0.3, - ), - "effects": Compound( - { - "mood_sound": Compound( - { - "offset": Double( - 2.0, - ), - "block_search_extent": Int( - 8, - ), - "tick_delay": Int( - 6000, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - "water_fog_color": Int( - 329011, - ), - "fog_color": Int( - 12638463, - ), - "sky_color": Int( - 8233727, - ), - "water_color": Int( - 4159204, - ), - }, - ), - "precipitation": String( - "rain", - ), - }, - ), - "name": String( - "minecraft:windswept_forest", - ), - "id": Int( - 21, - ), - }, - ), - Compound( - { - "id": Int( - 22, - ), - "element": Compound( - { - "effects": Compound( - { - "mood_sound": Compound( - { - "sound": String( - "minecraft:ambient.cave", - ), - "block_search_extent": Int( - 8, - ), - "offset": Double( - 2.0, - ), - "tick_delay": Int( - 6000, - ), - }, - ), - "water_fog_color": Int( - 329011, - ), - "water_color": Int( - 4159204, - ), - "sky_color": Int( - 7254527, - ), - "fog_color": Int( - 12638463, - ), - }, - ), - "temperature": Float( - 2.0, - ), - "precipitation": String( - "none", - ), - "downfall": Float( - 0.0, - ), - }, - ), - "name": String( - "minecraft:windswept_savanna", - ), - }, - ), - Compound( - { - "element": Compound( - { - "downfall": Float( - 0.9, - ), - "temperature": Float( - 0.95, - ), - "effects": Compound( - { - "water_fog_color": Int( - 329011, - ), - "music": Compound( - { - "max_delay": Int( - 24000, - ), - "sound": String( - "minecraft:music.overworld.jungle_and_forest", - ), - "replace_current_music": Byte( - 0, - ), - "min_delay": Int( - 12000, - ), - }, - ), - "fog_color": Int( - 12638463, - ), - "water_color": Int( - 4159204, - ), - "mood_sound": Compound( - { - "sound": String( - "minecraft:ambient.cave", - ), - "offset": Double( - 2.0, - ), - "block_search_extent": Int( - 8, - ), - "tick_delay": Int( - 6000, - ), - }, - ), - "sky_color": Int( - 7842047, - ), - }, - ), - "precipitation": String( - "rain", - ), - }, - ), - "name": String( - "minecraft:jungle", - ), - "id": Int( - 23, - ), - }, - ), - Compound( - { - "id": Int( - 24, - ), - "element": Compound( - { - "temperature": Float( - 0.95, - ), - "precipitation": String( - "rain", - ), - "effects": Compound( - { - "water_color": Int( - 4159204, - ), - "water_fog_color": Int( - 329011, - ), - "music": Compound( - { - "min_delay": Int( - 12000, - ), - "sound": String( - "minecraft:music.overworld.jungle_and_forest", - ), - "replace_current_music": Byte( - 0, - ), - "max_delay": Int( - 24000, - ), - }, - ), - "sky_color": Int( - 7842047, - ), - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "block_search_extent": Int( - 8, - ), - "offset": Double( - 2.0, - ), - }, - ), - "fog_color": Int( - 12638463, - ), - }, - ), - "downfall": Float( - 0.8, - ), - }, - ), - "name": String( - "minecraft:sparse_jungle", - ), - }, - ), - Compound( - { - "name": String( - "minecraft:bamboo_jungle", - ), - "id": Int( - 25, - ), - "element": Compound( - { - "precipitation": String( - "rain", - ), - "temperature": Float( - 0.95, - ), - "effects": Compound( - { - "fog_color": Int( - 12638463, - ), - "music": Compound( - { - "min_delay": Int( - 12000, - ), - "max_delay": Int( - 24000, - ), - "replace_current_music": Byte( - 0, - ), - "sound": String( - "minecraft:music.overworld.jungle_and_forest", - ), - }, - ), - "sky_color": Int( - 7842047, - ), - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "offset": Double( - 2.0, - ), - "block_search_extent": Int( - 8, - ), - }, - ), - "water_fog_color": Int( - 329011, - ), - "water_color": Int( - 4159204, - ), - }, - ), - "downfall": Float( - 0.9, - ), - }, - ), - }, - ), - Compound( - { - "id": Int( - 26, - ), - "name": String( - "minecraft:badlands", - ), - "element": Compound( - { - "temperature": Float( - 2.0, - ), - "effects": Compound( - { - "water_color": Int( - 4159204, - ), - "foliage_color": Int( - 10387789, - ), - "mood_sound": Compound( - { - "sound": String( - "minecraft:ambient.cave", - ), - "tick_delay": Int( - 6000, - ), - "block_search_extent": Int( - 8, - ), - "offset": Double( - 2.0, - ), - }, - ), - "sky_color": Int( - 7254527, - ), - "fog_color": Int( - 12638463, - ), - "grass_color": Int( - 9470285, - ), - "water_fog_color": Int( - 329011, - ), - }, - ), - "precipitation": String( - "none", - ), - "downfall": Float( - 0.0, - ), - }, - ), - }, - ), - Compound( - { - "element": Compound( - { - "temperature": Float( - 2.0, - ), - "precipitation": String( - "none", - ), - "downfall": Float( - 0.0, - ), - "effects": Compound( - { - "water_fog_color": Int( - 329011, - ), - "fog_color": Int( - 12638463, - ), - "water_color": Int( - 4159204, - ), - "mood_sound": Compound( - { - "block_search_extent": Int( - 8, - ), - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "tick_delay": Int( - 6000, - ), - }, - ), - "sky_color": Int( - 7254527, - ), - "foliage_color": Int( - 10387789, - ), - "grass_color": Int( - 9470285, - ), - }, - ), - }, - ), - "id": Int( - 27, - ), - "name": String( - "minecraft:eroded_badlands", - ), - }, - ), - Compound( - { - "id": Int( - 28, - ), - "name": String( - "minecraft:wooded_badlands", - ), - "element": Compound( - { - "effects": Compound( - { - "water_fog_color": Int( - 329011, - ), - "water_color": Int( - 4159204, - ), - "sky_color": Int( - 7254527, - ), - "mood_sound": Compound( - { - "offset": Double( - 2.0, - ), - "block_search_extent": Int( - 8, - ), - "tick_delay": Int( - 6000, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - "fog_color": Int( - 12638463, - ), - "foliage_color": Int( - 10387789, - ), - "grass_color": Int( - 9470285, - ), - }, - ), - "precipitation": String( - "none", - ), - "downfall": Float( - 0.0, - ), - "temperature": Float( - 2.0, - ), - }, - ), - }, - ), - Compound( - { - "element": Compound( - { - "effects": Compound( - { - "music": Compound( - { - "max_delay": Int( - 24000, - ), - "sound": String( - "minecraft:music.overworld.meadow", - ), - "min_delay": Int( - 12000, - ), - "replace_current_music": Byte( - 0, - ), - }, - ), - "water_color": Int( - 937679, - ), - "sky_color": Int( - 8103167, - ), - "fog_color": Int( - 12638463, - ), - "mood_sound": Compound( - { - "block_search_extent": Int( - 8, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "offset": Double( - 2.0, - ), - "tick_delay": Int( - 6000, - ), - }, - ), - "water_fog_color": Int( - 329011, - ), - }, - ), - "precipitation": String( - "rain", - ), - "temperature": Float( - 0.5, - ), - "downfall": Float( - 0.8, - ), - }, - ), - "name": String( - "minecraft:meadow", - ), - "id": Int( - 29, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:grove", - ), - "id": Int( - 30, - ), - "element": Compound( - { - "precipitation": String( - "snow", - ), - "downfall": Float( - 0.8, - ), - "effects": Compound( - { - "fog_color": Int( - 12638463, - ), - "music": Compound( - { - "replace_current_music": Byte( - 0, - ), - "sound": String( - "minecraft:music.overworld.grove", - ), - "min_delay": Int( - 12000, - ), - "max_delay": Int( - 24000, - ), - }, - ), - "water_fog_color": Int( - 329011, - ), - "water_color": Int( - 4159204, - ), - "sky_color": Int( - 8495359, - ), - "mood_sound": Compound( - { - "block_search_extent": Int( - 8, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "offset": Double( - 2.0, - ), - "tick_delay": Int( - 6000, - ), - }, - ), - }, - ), - "temperature": Float( - -0.2, - ), - }, - ), - }, - ), - Compound( - { - "element": Compound( - { - "temperature": Float( - -0.3, - ), - "downfall": Float( - 0.9, - ), - "precipitation": String( - "snow", - ), - "effects": Compound( - { - "music": Compound( - { - "min_delay": Int( - 12000, - ), - "max_delay": Int( - 24000, - ), - "replace_current_music": Byte( - 0, - ), - "sound": String( - "minecraft:music.overworld.snowy_slopes", - ), - }, - ), - "water_color": Int( - 4159204, - ), - "mood_sound": Compound( - { - "sound": String( - "minecraft:ambient.cave", - ), - "offset": Double( - 2.0, - ), - "tick_delay": Int( - 6000, - ), - "block_search_extent": Int( - 8, - ), - }, - ), - "sky_color": Int( - 8560639, - ), - "water_fog_color": Int( - 329011, - ), - "fog_color": Int( - 12638463, - ), - }, - ), - }, - ), - "id": Int( - 31, - ), - "name": String( - "minecraft:snowy_slopes", - ), - }, - ), - Compound( - { - "id": Int( - 32, - ), - "element": Compound( - { - "effects": Compound( - { - "music": Compound( - { - "max_delay": Int( - 24000, - ), - "replace_current_music": Byte( - 0, - ), - "min_delay": Int( - 12000, - ), - "sound": String( - "minecraft:music.overworld.frozen_peaks", - ), - }, - ), - "sky_color": Int( - 8756735, - ), - "water_fog_color": Int( - 329011, - ), - "fog_color": Int( - 12638463, - ), - "water_color": Int( - 4159204, - ), - "mood_sound": Compound( - { - "block_search_extent": Int( - 8, - ), - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - }, - ), - "precipitation": String( - "snow", - ), - "temperature": Float( - -0.7, - ), - "downfall": Float( - 0.9, - ), - }, - ), - "name": String( - "minecraft:frozen_peaks", - ), - }, - ), - Compound( - { - "id": Int( - 33, - ), - "name": String( - "minecraft:jagged_peaks", - ), - "element": Compound( - { - "precipitation": String( - "snow", - ), - "effects": Compound( - { - "water_fog_color": Int( - 329011, - ), - "water_color": Int( - 4159204, - ), - "music": Compound( - { - "min_delay": Int( - 12000, - ), - "sound": String( - "minecraft:music.overworld.jagged_peaks", - ), - "replace_current_music": Byte( - 0, - ), - "max_delay": Int( - 24000, - ), - }, - ), - "sky_color": Int( - 8756735, - ), - "mood_sound": Compound( - { - "block_search_extent": Int( - 8, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - }, - ), - "fog_color": Int( - 12638463, - ), - }, - ), - "temperature": Float( - -0.7, - ), - "downfall": Float( - 0.9, - ), - }, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:stony_peaks", - ), - "id": Int( - 34, - ), - "element": Compound( - { - "downfall": Float( - 0.3, - ), - "effects": Compound( - { - "water_fog_color": Int( - 329011, - ), - "music": Compound( - { - "min_delay": Int( - 12000, - ), - "replace_current_music": Byte( - 0, - ), - "sound": String( - "minecraft:music.overworld.stony_peaks", - ), - "max_delay": Int( - 24000, - ), - }, - ), - "sky_color": Int( - 7776511, - ), - "water_color": Int( - 4159204, - ), - "fog_color": Int( - 12638463, - ), - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "block_search_extent": Int( - 8, - ), - "offset": Double( - 2.0, - ), - }, - ), - }, - ), - "precipitation": String( - "rain", - ), - "temperature": Float( - 1.0, - ), - }, - ), - }, - ), - Compound( - { - "element": Compound( - { - "downfall": Float( - 0.5, - ), - "precipitation": String( - "rain", - ), - "effects": Compound( - { - "fog_color": Int( - 12638463, - ), - "water_fog_color": Int( - 329011, - ), - "water_color": Int( - 4159204, - ), - "sky_color": Int( - 8103167, - ), - "mood_sound": Compound( - { - "sound": String( - "minecraft:ambient.cave", - ), - "tick_delay": Int( - 6000, - ), - "block_search_extent": Int( - 8, - ), - "offset": Double( - 2.0, - ), - }, - ), - }, - ), - "temperature": Float( - 0.5, - ), - }, - ), - "id": Int( - 35, - ), - "name": String( - "minecraft:river", - ), - }, - ), - Compound( - { - "element": Compound( - { - "precipitation": String( - "snow", - ), - "temperature": Float( - 0.0, - ), - "effects": Compound( - { - "water_fog_color": Int( - 329011, - ), - "sky_color": Int( - 8364543, - ), - "fog_color": Int( - 12638463, - ), - "water_color": Int( - 3750089, - ), - "mood_sound": Compound( - { - "block_search_extent": Int( - 8, - ), - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - }, - ), - "downfall": Float( - 0.5, - ), - }, - ), - "name": String( - "minecraft:frozen_river", - ), - "id": Int( - 36, - ), - }, - ), - Compound( - { - "element": Compound( - { - "downfall": Float( - 0.4, - ), - "precipitation": String( - "rain", - ), - "effects": Compound( - { - "water_fog_color": Int( - 329011, - ), - "fog_color": Int( - 12638463, - ), - "sky_color": Int( - 7907327, - ), - "mood_sound": Compound( - { - "sound": String( - "minecraft:ambient.cave", - ), - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "block_search_extent": Int( - 8, - ), - }, - ), - "water_color": Int( - 4159204, - ), - }, - ), - "temperature": Float( - 0.8, - ), - }, - ), - "name": String( - "minecraft:beach", - ), - "id": Int( - 37, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:snowy_beach", - ), - "id": Int( - 38, - ), - "element": Compound( - { - "temperature": Float( - 0.05, - ), - "downfall": Float( - 0.3, - ), - "precipitation": String( - "snow", - ), - "effects": Compound( - { - "sky_color": Int( - 8364543, - ), - "water_color": Int( - 4020182, - ), - "water_fog_color": Int( - 329011, - ), - "fog_color": Int( - 12638463, - ), - "mood_sound": Compound( - { - "offset": Double( - 2.0, - ), - "tick_delay": Int( - 6000, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "block_search_extent": Int( - 8, - ), - }, - ), - }, - ), - }, - ), - }, - ), - Compound( - { - "element": Compound( - { - "precipitation": String( - "rain", - ), - "temperature": Float( - 0.2, - ), - "downfall": Float( - 0.3, - ), - "effects": Compound( - { - "sky_color": Int( - 8233727, - ), - "fog_color": Int( - 12638463, - ), - "water_color": Int( - 4159204, - ), - "mood_sound": Compound( - { - "offset": Double( - 2.0, - ), - "block_search_extent": Int( - 8, - ), - "tick_delay": Int( - 6000, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - "water_fog_color": Int( - 329011, - ), - }, - ), - }, - ), - "name": String( - "minecraft:stony_shore", - ), - "id": Int( - 39, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:warm_ocean", - ), - "id": Int( - 40, - ), - "element": Compound( - { - "effects": Compound( - { - "sky_color": Int( - 8103167, - ), - "water_fog_color": Int( - 270131, - ), - "water_color": Int( - 4445678, - ), - "fog_color": Int( - 12638463, - ), - "mood_sound": Compound( - { - "offset": Double( - 2.0, - ), - "tick_delay": Int( - 6000, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "block_search_extent": Int( - 8, - ), - }, - ), - }, - ), - "temperature": Float( - 0.5, - ), - "downfall": Float( - 0.5, - ), - "precipitation": String( - "rain", - ), - }, - ), - }, - ), - Compound( - { - "element": Compound( - { - "effects": Compound( - { - "mood_sound": Compound( - { - "block_search_extent": Int( - 8, - ), - "tick_delay": Int( - 6000, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "offset": Double( - 2.0, - ), - }, - ), - "fog_color": Int( - 12638463, - ), - "water_fog_color": Int( - 267827, - ), - "water_color": Int( - 4566514, - ), - "sky_color": Int( - 8103167, - ), - }, - ), - "precipitation": String( - "rain", - ), - "temperature": Float( - 0.5, - ), - "downfall": Float( - 0.5, - ), - }, - ), - "name": String( - "minecraft:lukewarm_ocean", - ), - "id": Int( - 41, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:deep_lukewarm_ocean", - ), - "id": Int( - 42, - ), - "element": Compound( - { - "downfall": Float( - 0.5, - ), - "temperature": Float( - 0.5, - ), - "effects": Compound( - { - "water_color": Int( - 4566514, - ), - "mood_sound": Compound( - { - "offset": Double( - 2.0, - ), - "block_search_extent": Int( - 8, - ), - "tick_delay": Int( - 6000, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - "sky_color": Int( - 8103167, - ), - "water_fog_color": Int( - 267827, - ), - "fog_color": Int( - 12638463, - ), - }, - ), - "precipitation": String( - "rain", - ), - }, - ), - }, - ), - Compound( - { - "id": Int( - 43, - ), - "element": Compound( - { - "temperature": Float( - 0.5, - ), - "precipitation": String( - "rain", - ), - "downfall": Float( - 0.5, - ), - "effects": Compound( - { - "water_color": Int( - 4159204, - ), - "mood_sound": Compound( - { - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "block_search_extent": Int( - 8, - ), - "tick_delay": Int( - 6000, - ), - }, - ), - "fog_color": Int( - 12638463, - ), - "water_fog_color": Int( - 329011, - ), - "sky_color": Int( - 8103167, - ), - }, - ), - }, - ), - "name": String( - "minecraft:ocean", - ), - }, - ), - Compound( - { - "name": String( - "minecraft:deep_ocean", - ), - "element": Compound( - { - "downfall": Float( - 0.5, - ), - "effects": Compound( - { - "mood_sound": Compound( - { - "block_search_extent": Int( - 8, - ), - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - "sky_color": Int( - 8103167, - ), - "water_fog_color": Int( - 329011, - ), - "water_color": Int( - 4159204, - ), - "fog_color": Int( - 12638463, - ), - }, - ), - "temperature": Float( - 0.5, - ), - "precipitation": String( - "rain", - ), - }, - ), - "id": Int( - 44, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:cold_ocean", - ), - "id": Int( - 45, - ), - "element": Compound( - { - "effects": Compound( - { - "fog_color": Int( - 12638463, - ), - "water_color": Int( - 4020182, - ), - "water_fog_color": Int( - 329011, - ), - "sky_color": Int( - 8103167, - ), - "mood_sound": Compound( - { - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "tick_delay": Int( - 6000, - ), - "block_search_extent": Int( - 8, - ), - }, - ), - }, - ), - "temperature": Float( - 0.5, - ), - "precipitation": String( - "rain", - ), - "downfall": Float( - 0.5, - ), - }, - ), - }, - ), - Compound( - { - "id": Int( - 46, - ), - "element": Compound( - { - "precipitation": String( - "rain", - ), - "effects": Compound( - { - "fog_color": Int( - 12638463, - ), - "water_fog_color": Int( - 329011, - ), - "water_color": Int( - 4020182, - ), - "mood_sound": Compound( - { - "block_search_extent": Int( - 8, - ), - "offset": Double( - 2.0, - ), - "tick_delay": Int( - 6000, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - "sky_color": Int( - 8103167, - ), - }, - ), - "temperature": Float( - 0.5, - ), - "downfall": Float( - 0.5, - ), - }, - ), - "name": String( - "minecraft:deep_cold_ocean", - ), - }, - ), - Compound( - { - "id": Int( - 47, - ), - "name": String( - "minecraft:frozen_ocean", - ), - "element": Compound( - { - "temperature_modifier": String( - "frozen", - ), - "temperature": Float( - 0.0, - ), - "precipitation": String( - "snow", - ), - "effects": Compound( - { - "sky_color": Int( - 8364543, - ), - "water_fog_color": Int( - 329011, - ), - "water_color": Int( - 3750089, - ), - "mood_sound": Compound( - { - "block_search_extent": Int( - 8, - ), - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - "fog_color": Int( - 12638463, - ), - }, - ), - "downfall": Float( - 0.5, - ), - }, - ), - }, - ), - Compound( - { - "id": Int( - 48, - ), - "element": Compound( - { - "downfall": Float( - 0.5, - ), - "temperature_modifier": String( - "frozen", - ), - "precipitation": String( - "rain", - ), - "effects": Compound( - { - "water_fog_color": Int( - 329011, - ), - "sky_color": Int( - 8103167, - ), - "fog_color": Int( - 12638463, - ), - "mood_sound": Compound( - { - "sound": String( - "minecraft:ambient.cave", - ), - "tick_delay": Int( - 6000, - ), - "block_search_extent": Int( - 8, - ), - "offset": Double( - 2.0, - ), - }, - ), - "water_color": Int( - 3750089, - ), - }, - ), - "temperature": Float( - 0.5, - ), - }, - ), - "name": String( - "minecraft:deep_frozen_ocean", - ), - }, - ), - Compound( - { - "element": Compound( - { - "downfall": Float( - 1.0, - ), - "temperature": Float( - 0.9, - ), - "precipitation": String( - "rain", - ), - "effects": Compound( - { - "water_color": Int( - 4159204, - ), - "water_fog_color": Int( - 329011, - ), - "fog_color": Int( - 12638463, - ), - "sky_color": Int( - 7842047, - ), - "mood_sound": Compound( - { - "sound": String( - "minecraft:ambient.cave", - ), - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "block_search_extent": Int( - 8, - ), - }, - ), - }, - ), - }, - ), - "id": Int( - 49, - ), - "name": String( - "minecraft:mushroom_fields", - ), - }, - ), - Compound( - { - "element": Compound( - { - "precipitation": String( - "rain", - ), - "temperature": Float( - 0.8, - ), - "downfall": Float( - 0.4, - ), - "effects": Compound( - { - "fog_color": Int( - 12638463, - ), - "water_color": Int( - 4159204, - ), - "water_fog_color": Int( - 329011, - ), - "mood_sound": Compound( - { - "offset": Double( - 2.0, - ), - "block_search_extent": Int( - 8, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "tick_delay": Int( - 6000, - ), - }, - ), - "sky_color": Int( - 7907327, - ), - "music": Compound( - { - "max_delay": Int( - 24000, - ), - "sound": String( - "minecraft:music.overworld.dripstone_caves", - ), - "replace_current_music": Byte( - 0, - ), - "min_delay": Int( - 12000, - ), - }, - ), - }, - ), - }, - ), - "name": String( - "minecraft:dripstone_caves", - ), - "id": Int( - 50, - ), - }, - ), - Compound( - { - "id": Int( - 51, - ), - "name": String( - "minecraft:lush_caves", - ), - "element": Compound( - { - "effects": Compound( - { - "water_fog_color": Int( - 329011, - ), - "fog_color": Int( - 12638463, - ), - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "block_search_extent": Int( - 8, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "offset": Double( - 2.0, - ), - }, - ), - "music": Compound( - { - "max_delay": Int( - 24000, - ), - "min_delay": Int( - 12000, - ), - "sound": String( - "minecraft:music.overworld.lush_caves", - ), - "replace_current_music": Byte( - 0, - ), - }, - ), - "water_color": Int( - 4159204, - ), - "sky_color": Int( - 8103167, - ), - }, - ), - "temperature": Float( - 0.5, - ), - "precipitation": String( - "rain", - ), - "downfall": Float( - 0.5, - ), - }, - ), - }, - ), - Compound( - { - "element": Compound( - { - "precipitation": String( - "rain", - ), - "temperature": Float( - 0.8, - ), - "effects": Compound( - { - "mood_sound": Compound( - { - "block_search_extent": Int( - 8, - ), - "offset": Double( - 2.0, - ), - "tick_delay": Int( - 6000, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - "water_fog_color": Int( - 329011, - ), - "fog_color": Int( - 12638463, - ), - "music": Compound( - { - "min_delay": Int( - 12000, - ), - "max_delay": Int( - 24000, - ), - "replace_current_music": Byte( - 0, - ), - "sound": String( - "minecraft:music.overworld.deep_dark", - ), - }, - ), - "water_color": Int( - 4159204, - ), - "sky_color": Int( - 7907327, - ), - }, - ), - "downfall": Float( - 0.4, - ), - }, - ), - "id": Int( - 52, - ), - "name": String( - "minecraft:deep_dark", - ), - }, - ), - Compound( - { - "id": Int( - 53, - ), - "name": String( - "minecraft:nether_wastes", - ), - "element": Compound( - { - "effects": Compound( - { - "music": Compound( - { - "max_delay": Int( - 24000, - ), - "sound": String( - "minecraft:music.nether.nether_wastes", - ), - "min_delay": Int( - 12000, - ), - "replace_current_music": Byte( - 0, - ), - }, - ), - "water_color": Int( - 4159204, - ), - "sky_color": Int( - 7254527, - ), - "additions_sound": Compound( - { - "sound": String( - "minecraft:ambient.nether_wastes.additions", - ), - "tick_chance": Double( - 0.0111, - ), - }, - ), - "water_fog_color": Int( - 329011, - ), - "mood_sound": Compound( - { - "offset": Double( - 2.0, - ), - "block_search_extent": Int( - 8, - ), - "sound": String( - "minecraft:ambient.nether_wastes.mood", - ), - "tick_delay": Int( - 6000, - ), - }, - ), - "ambient_sound": String( - "minecraft:ambient.nether_wastes.loop", - ), - "fog_color": Int( - 3344392, - ), - }, - ), - "temperature": Float( - 2.0, - ), - "downfall": Float( - 0.0, - ), - "precipitation": String( - "none", - ), - }, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:warped_forest", - ), - "id": Int( - 54, - ), - "element": Compound( - { - "downfall": Float( - 0.0, - ), - "precipitation": String( - "none", - ), - "temperature": Float( - 2.0, - ), - "effects": Compound( - { - "ambient_sound": String( - "minecraft:ambient.warped_forest.loop", - ), - "particle": Compound( - { - "probability": Float( - 0.01428, - ), - "options": Compound( - { - "type": String( - "minecraft:warped_spore", - ), - }, - ), - }, - ), - "additions_sound": Compound( - { - "tick_chance": Double( - 0.0111, - ), - "sound": String( - "minecraft:ambient.warped_forest.additions", - ), - }, - ), - "water_fog_color": Int( - 329011, - ), - "fog_color": Int( - 1705242, - ), - "music": Compound( - { - "replace_current_music": Byte( - 0, - ), - "sound": String( - "minecraft:music.nether.warped_forest", - ), - "min_delay": Int( - 12000, - ), - "max_delay": Int( - 24000, - ), - }, - ), - "water_color": Int( - 4159204, - ), - "sky_color": Int( - 7254527, - ), - "mood_sound": Compound( - { - "offset": Double( - 2.0, - ), - "tick_delay": Int( - 6000, - ), - "sound": String( - "minecraft:ambient.warped_forest.mood", - ), - "block_search_extent": Int( - 8, - ), - }, - ), - }, - ), - }, - ), - }, - ), - Compound( - { - "id": Int( - 55, - ), - "name": String( - "minecraft:crimson_forest", - ), - "element": Compound( - { - "effects": Compound( - { - "ambient_sound": String( - "minecraft:ambient.crimson_forest.loop", - ), - "sky_color": Int( - 7254527, - ), - "fog_color": Int( - 3343107, - ), - "water_color": Int( - 4159204, - ), - "mood_sound": Compound( - { - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.crimson_forest.mood", - ), - "tick_delay": Int( - 6000, - ), - "block_search_extent": Int( - 8, - ), - }, - ), - "music": Compound( - { - "replace_current_music": Byte( - 0, - ), - "max_delay": Int( - 24000, - ), - "min_delay": Int( - 12000, - ), - "sound": String( - "minecraft:music.nether.crimson_forest", - ), - }, - ), - "additions_sound": Compound( - { - "sound": String( - "minecraft:ambient.crimson_forest.additions", - ), - "tick_chance": Double( - 0.0111, - ), - }, - ), - "particle": Compound( - { - "probability": Float( - 0.025, - ), - "options": Compound( - { - "type": String( - "minecraft:crimson_spore", - ), - }, - ), - }, - ), - "water_fog_color": Int( - 329011, - ), - }, - ), - "temperature": Float( - 2.0, - ), - "downfall": Float( - 0.0, - ), - "precipitation": String( - "none", - ), - }, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:soul_sand_valley", - ), - "id": Int( - 56, - ), - "element": Compound( - { - "downfall": Float( - 0.0, - ), - "effects": Compound( - { - "sky_color": Int( - 7254527, - ), - "music": Compound( - { - "min_delay": Int( - 12000, - ), - "replace_current_music": Byte( - 0, - ), - "sound": String( - "minecraft:music.nether.soul_sand_valley", - ), - "max_delay": Int( - 24000, - ), - }, - ), - "ambient_sound": String( - "minecraft:ambient.soul_sand_valley.loop", - ), - "particle": Compound( - { - "options": Compound( - { - "type": String( - "minecraft:ash", - ), - }, - ), - "probability": Float( - 0.00625, - ), - }, - ), - "water_color": Int( - 4159204, - ), - "mood_sound": Compound( - { - "block_search_extent": Int( - 8, - ), - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.soul_sand_valley.mood", - ), - }, - ), - "additions_sound": Compound( - { - "sound": String( - "minecraft:ambient.soul_sand_valley.additions", - ), - "tick_chance": Double( - 0.0111, - ), - }, - ), - "water_fog_color": Int( - 329011, - ), - "fog_color": Int( - 1787717, - ), - }, - ), - "precipitation": String( - "none", - ), - "temperature": Float( - 2.0, - ), - }, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:basalt_deltas", - ), - "id": Int( - 57, - ), - "element": Compound( - { - "downfall": Float( - 0.0, - ), - "effects": Compound( - { - "water_color": Int( - 4159204, - ), - "water_fog_color": Int( - 329011, - ), - "fog_color": Int( - 6840176, - ), - "sky_color": Int( - 7254527, - ), - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "block_search_extent": Int( - 8, - ), - "sound": String( - "minecraft:ambient.basalt_deltas.mood", - ), - "offset": Double( - 2.0, - ), - }, - ), - "music": Compound( - { - "min_delay": Int( - 12000, - ), - "max_delay": Int( - 24000, - ), - "replace_current_music": Byte( - 0, - ), - "sound": String( - "minecraft:music.nether.basalt_deltas", - ), - }, - ), - "ambient_sound": String( - "minecraft:ambient.basalt_deltas.loop", - ), - "additions_sound": Compound( - { - "sound": String( - "minecraft:ambient.basalt_deltas.additions", - ), - "tick_chance": Double( - 0.0111, - ), - }, - ), - "particle": Compound( - { - "probability": Float( - 0.118093334, - ), - "options": Compound( - { - "type": String( - "minecraft:white_ash", - ), - }, - ), - }, - ), - }, - ), - "temperature": Float( - 2.0, - ), - "precipitation": String( - "none", - ), - }, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:the_end", - ), - "element": Compound( - { - "temperature": Float( - 0.5, - ), - "effects": Compound( - { - "fog_color": Int( - 10518688, - ), - "sky_color": Int( - 0, - ), - "water_fog_color": Int( - 329011, - ), - "water_color": Int( - 4159204, - ), - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "block_search_extent": Int( - 8, - ), - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - }, - ), - "downfall": Float( - 0.5, - ), - "precipitation": String( - "none", - ), - }, - ), - "id": Int( - 58, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:end_highlands", - ), - "id": Int( - 59, - ), - "element": Compound( - { - "downfall": Float( - 0.5, - ), - "temperature": Float( - 0.5, - ), - "precipitation": String( - "none", - ), - "effects": Compound( - { - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "block_search_extent": Int( - 8, - ), - }, - ), - "fog_color": Int( - 10518688, - ), - "sky_color": Int( - 0, - ), - "water_fog_color": Int( - 329011, - ), - "water_color": Int( - 4159204, - ), - }, - ), - }, - ), - }, - ), - Compound( - { - "element": Compound( - { - "temperature": Float( - 0.5, - ), - "downfall": Float( - 0.5, - ), - "precipitation": String( - "none", - ), - "effects": Compound( - { - "sky_color": Int( - 0, - ), - "water_color": Int( - 4159204, - ), - "water_fog_color": Int( - 329011, - ), - "fog_color": Int( - 10518688, - ), - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "block_search_extent": Int( - 8, - ), - "offset": Double( - 2.0, - ), - }, - ), - }, - ), - }, - ), - "name": String( - "minecraft:end_midlands", - ), - "id": Int( - 60, - ), - }, - ), - Compound( - { - "id": Int( - 61, - ), - "name": String( - "minecraft:small_end_islands", - ), - "element": Compound( - { - "temperature": Float( - 0.5, - ), - "precipitation": String( - "none", - ), - "effects": Compound( - { - "sky_color": Int( - 0, - ), - "mood_sound": Compound( - { - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "tick_delay": Int( - 6000, - ), - "block_search_extent": Int( - 8, - ), - }, - ), - "fog_color": Int( - 10518688, - ), - "water_fog_color": Int( - 329011, - ), - "water_color": Int( - 4159204, - ), - }, - ), - "downfall": Float( - 0.5, - ), - }, - ), - }, - ), - Compound( - { - "id": Int( - 62, - ), - "element": Compound( - { - "temperature": Float( - 0.5, - ), - "downfall": Float( - 0.5, - ), - "precipitation": String( - "none", - ), - "effects": Compound( - { - "water_fog_color": Int( - 329011, - ), - "water_color": Int( - 4159204, - ), - "fog_color": Int( - 10518688, - ), - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "block_search_extent": Int( - 8, - ), - }, - ), - "sky_color": Int( - 0, - ), - }, - ), - }, - ), - "name": String( - "minecraft:end_barrens", - ), - }, - ), - ], - ), - }, - ), - "minecraft:dimension_type": Compound( - { - "type": String( - "minecraft:dimension_type", - ), - "value": List( - [ - Compound( - { - "id": Int( - 0, - ), - "name": String( - "minecraft:overworld", - ), - "element": Compound( - { - "infiniburn": String( - "#minecraft:infiniburn_overworld", - ), - "respawn_anchor_works": Byte( - 0, - ), - "bed_works": Byte( - 1, - ), - "has_skylight": Byte( - 1, - ), - "natural": Byte( - 1, - ), - "effects": String( - "minecraft:overworld", - ), - "height": Int( - 384, - ), - "monster_spawn_light_level": Compound( - { - "type": String( - "minecraft:uniform", - ), - "value": Compound( - { - "min_inclusive": Int( - 0, - ), - "max_inclusive": Int( - 7, - ), - }, - ), - }, - ), - "has_raids": Byte( - 1, - ), - "ultrawarm": Byte( - 0, - ), - "min_y": Int( - -64, - ), - "monster_spawn_block_light_limit": Int( - 0, - ), - "logical_height": Int( - 384, - ), - "ambient_light": Float( - 0.0, - ), - "coordinate_scale": Double( - 1.0, - ), - "piglin_safe": Byte( - 0, - ), - "has_ceiling": Byte( - 0, - ), - }, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:the_nether", - ), - "id": Int( - 1, - ), - "element": Compound( - { - "has_raids": Byte( - 0, - ), - "coordinate_scale": Double( - 8.0, - ), - "piglin_safe": Byte( - 1, - ), - "monster_spawn_block_light_limit": Int( - 15, - ), - "monster_spawn_light_level": Int( - 11, - ), - "respawn_anchor_works": Byte( - 1, - ), - "effects": String( - "minecraft:the_nether", - ), - "fixed_time": Long( - 18000, - ), - "infiniburn": String( - "#minecraft:infiniburn_nether", - ), - "has_skylight": Byte( - 0, - ), - "logical_height": Int( - 128, - ), - "has_ceiling": Byte( - 1, - ), - "ambient_light": Float( - 0.1, - ), - "bed_works": Byte( - 0, - ), - "height": Int( - 256, - ), - "natural": Byte( - 0, - ), - "min_y": Int( - 0, - ), - "ultrawarm": Byte( - 1, - ), - }, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:the_end", - ), - "element": Compound( - { - "has_ceiling": Byte( - 0, - ), - "fixed_time": Long( - 6000, - ), - "effects": String( - "minecraft:the_end", - ), - "coordinate_scale": Double( - 1.0, - ), - "height": Int( - 256, - ), - "infiniburn": String( - "#minecraft:infiniburn_end", - ), - "ambient_light": Float( - 0.0, - ), - "has_skylight": Byte( - 0, - ), - "has_raids": Byte( - 1, - ), - "monster_spawn_block_light_limit": Int( - 0, - ), - "monster_spawn_light_level": Compound( - { - "value": Compound( - { - "min_inclusive": Int( - 0, - ), - "max_inclusive": Int( - 7, - ), - }, - ), - "type": String( - "minecraft:uniform", - ), - }, - ), - "piglin_safe": Byte( - 0, - ), - "natural": Byte( - 0, - ), - "respawn_anchor_works": Byte( - 0, - ), - "logical_height": Int( - 256, - ), - "ultrawarm": Byte( - 0, - ), - "min_y": Int( - 0, - ), - "bed_works": Byte( - 0, - ), - }, - ), - "id": Int( - 2, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:overworld_caves", - ), - "id": Int( - 3, - ), - "element": Compound( - { - "monster_spawn_block_light_limit": Int( - 0, - ), - "height": Int( - 384, - ), - "logical_height": Int( - 384, - ), - "min_y": Int( - -64, - ), - "has_ceiling": Byte( - 1, - ), - "effects": String( - "minecraft:overworld", - ), - "has_raids": Byte( - 1, - ), - "ambient_light": Float( - 0.0, - ), - "piglin_safe": Byte( - 0, - ), - "infiniburn": String( - "#minecraft:infiniburn_overworld", - ), - "respawn_anchor_works": Byte( - 0, - ), - "natural": Byte( - 1, - ), - "ultrawarm": Byte( - 0, - ), - "monster_spawn_light_level": Compound( - { - "type": String( - "minecraft:uniform", - ), - "value": Compound( - { - "min_inclusive": Int( - 0, - ), - "max_inclusive": Int( - 7, - ), - }, - ), - }, - ), - "has_skylight": Byte( - 1, - ), - "coordinate_scale": Double( - 1.0, - ), - "bed_works": Byte( - 1, - ), - }, - ), - }, - ), - ], + "minecraft:chat_type", ), }, ), From 0c0fec00655fd5850e2123cb6fc2da94731dd409 Mon Sep 17 00:00:00 2001 From: mat Date: Thu, 26 May 2022 19:12:19 -0500 Subject: [PATCH 23/27] fix some packets --- azalea-client/src/connect.rs | 15 +- azalea-protocol/packet-macros/src/lib.rs | 7 +- .../game/clientbound_add_entity_packet.rs | 13 +- login.txt | 4812 ----------------- 4 files changed, 18 insertions(+), 4829 deletions(-) delete mode 100644 login.txt diff --git a/azalea-client/src/connect.rs b/azalea-client/src/connect.rs index e63c9b07..cb2bec9c 100755 --- a/azalea-client/src/connect.rs +++ b/azalea-client/src/connect.rs @@ -200,12 +200,12 @@ impl Client { let mut state = state.lock().await; - // write p into login.txt - std::io::Write::write_all( - &mut std::fs::File::create("login.txt").unwrap(), - format!("{:#?}", p).as_bytes(), - ) - .unwrap(); + // // write p into login.txt + // std::io::Write::write_all( + // &mut std::fs::File::create("login.txt").unwrap(), + // format!("{:#?}", p).as_bytes(), + // ) + // .unwrap(); state.player.entity.id = p.player_id; @@ -444,6 +444,9 @@ impl Client { GamePacket::ClientboundLevelParticlesPacket(p) => { println!("Got level particles packet {:?}", p); } + GamePacket::ClientboundServerDataPacket(p) => { + println!("Got server data packet {:?}", p); + } _ => panic!("Unexpected packet {:?}", packet), } } diff --git a/azalea-protocol/packet-macros/src/lib.rs b/azalea-protocol/packet-macros/src/lib.rs index 927e783b..5ea69a62 100755 --- a/azalea-protocol/packet-macros/src/lib.rs +++ b/azalea-protocol/packet-macros/src/lib.rs @@ -354,7 +354,7 @@ pub fn declare_state_packets(input: TokenStream) -> TokenStream { }); } for PacketIdPair { id, module, name } in input.clientbound.packets { - let name_litstr = syn::LitStr::new(&name.to_string(), name.span()); + // let name_litstr = syn::LitStr::new(&name.to_string(), name.span()); enum_contents.extend(quote! { #name(#module::#name), }); @@ -365,10 +365,7 @@ pub fn declare_state_packets(input: TokenStream) -> TokenStream { #state_name::#name(packet) => packet.write(buf), }); clientbound_read_match_contents.extend(quote! { - #id => { - println!("reading packet {}", #name_litstr); - #module::#name::read(buf)? - }, + #id => #module::#name::read(buf)?, }); } diff --git a/azalea-protocol/src/packets/game/clientbound_add_entity_packet.rs b/azalea-protocol/src/packets/game/clientbound_add_entity_packet.rs index 9afd151b..8a8a713e 100644 --- a/azalea-protocol/src/packets/game/clientbound_add_entity_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_add_entity_packet.rs @@ -4,9 +4,9 @@ use uuid::Uuid; #[derive(Clone, Debug, McBuf, GamePacket)] pub struct ClientboundAddEntityPacket { #[var] - pub id: i32, + pub id: u32, pub uuid: Uuid, - // TODO: have an entity type struct + // TODO: have an entity type enum/struct #[var] pub entity_type: i32, pub x: f64, @@ -14,9 +14,10 @@ pub struct ClientboundAddEntityPacket { pub z: f64, pub x_rot: i8, pub y_rot: i8, - // pub y_head_rot: i8, + pub y_head_rot: i8, + #[var] pub data: i32, - pub x_vel: u16, - pub y_vel: u16, - pub z_vel: u16, + pub x_vel: i16, + pub y_vel: i16, + pub z_vel: i16, } diff --git a/login.txt b/login.txt deleted file mode 100644 index d196e98c..00000000 --- a/login.txt +++ /dev/null @@ -1,4812 +0,0 @@ -ClientboundLoginPacket { - player_id: 41695, - hardcore: false, - game_type: CREATIVE, - previous_game_type: None, - levels: [ - minecraft:overworld, - minecraft:the_nether, - minecraft:the_end, - ], - registry_holder: Compound( - { - "": Compound( - { - "minecraft:dimension_type": Compound( - { - "type": String( - "minecraft:dimension_type", - ), - "value": List( - [ - Compound( - { - "element": Compound( - { - "has_ceiling": Byte( - 0, - ), - "bed_works": Byte( - 1, - ), - "logical_height": Int( - 384, - ), - "ambient_light": Float( - 0.0, - ), - "infiniburn": String( - "#minecraft:infiniburn_overworld", - ), - "has_raids": Byte( - 1, - ), - "piglin_safe": Byte( - 0, - ), - "coordinate_scale": Double( - 1.0, - ), - "min_y": Int( - -64, - ), - "respawn_anchor_works": Byte( - 0, - ), - "natural": Byte( - 1, - ), - "height": Int( - 384, - ), - "monster_spawn_block_light_limit": Int( - 0, - ), - "has_skylight": Byte( - 1, - ), - "ultrawarm": Byte( - 0, - ), - "effects": String( - "minecraft:overworld", - ), - "monster_spawn_light_level": Compound( - { - "type": String( - "minecraft:uniform", - ), - "value": Compound( - { - "max_inclusive": Int( - 7, - ), - "min_inclusive": Int( - 0, - ), - }, - ), - }, - ), - }, - ), - "id": Int( - 0, - ), - "name": String( - "minecraft:overworld", - ), - }, - ), - Compound( - { - "element": Compound( - { - "fixed_time": Long( - 18000, - ), - "height": Int( - 256, - ), - "coordinate_scale": Double( - 8.0, - ), - "bed_works": Byte( - 0, - ), - "ambient_light": Float( - 0.1, - ), - "monster_spawn_light_level": Int( - 11, - ), - "respawn_anchor_works": Byte( - 1, - ), - "effects": String( - "minecraft:the_nether", - ), - "min_y": Int( - 0, - ), - "natural": Byte( - 0, - ), - "has_ceiling": Byte( - 1, - ), - "has_raids": Byte( - 0, - ), - "logical_height": Int( - 128, - ), - "piglin_safe": Byte( - 1, - ), - "monster_spawn_block_light_limit": Int( - 15, - ), - "infiniburn": String( - "#minecraft:infiniburn_nether", - ), - "has_skylight": Byte( - 0, - ), - "ultrawarm": Byte( - 1, - ), - }, - ), - "name": String( - "minecraft:the_nether", - ), - "id": Int( - 1, - ), - }, - ), - Compound( - { - "id": Int( - 2, - ), - "element": Compound( - { - "monster_spawn_light_level": Compound( - { - "type": String( - "minecraft:uniform", - ), - "value": Compound( - { - "min_inclusive": Int( - 0, - ), - "max_inclusive": Int( - 7, - ), - }, - ), - }, - ), - "min_y": Int( - 0, - ), - "natural": Byte( - 0, - ), - "logical_height": Int( - 256, - ), - "has_raids": Byte( - 1, - ), - "monster_spawn_block_light_limit": Int( - 0, - ), - "ambient_light": Float( - 0.0, - ), - "infiniburn": String( - "#minecraft:infiniburn_end", - ), - "ultrawarm": Byte( - 0, - ), - "has_ceiling": Byte( - 0, - ), - "has_skylight": Byte( - 0, - ), - "fixed_time": Long( - 6000, - ), - "piglin_safe": Byte( - 0, - ), - "bed_works": Byte( - 0, - ), - "effects": String( - "minecraft:the_end", - ), - "respawn_anchor_works": Byte( - 0, - ), - "coordinate_scale": Double( - 1.0, - ), - "height": Int( - 256, - ), - }, - ), - "name": String( - "minecraft:the_end", - ), - }, - ), - Compound( - { - "id": Int( - 3, - ), - "name": String( - "minecraft:overworld_caves", - ), - "element": Compound( - { - "effects": String( - "minecraft:overworld", - ), - "bed_works": Byte( - 1, - ), - "ultrawarm": Byte( - 0, - ), - "respawn_anchor_works": Byte( - 0, - ), - "monster_spawn_block_light_limit": Int( - 0, - ), - "has_raids": Byte( - 1, - ), - "ambient_light": Float( - 0.0, - ), - "infiniburn": String( - "#minecraft:infiniburn_overworld", - ), - "logical_height": Int( - 384, - ), - "min_y": Int( - -64, - ), - "height": Int( - 384, - ), - "monster_spawn_light_level": Compound( - { - "value": Compound( - { - "min_inclusive": Int( - 0, - ), - "max_inclusive": Int( - 7, - ), - }, - ), - "type": String( - "minecraft:uniform", - ), - }, - ), - "piglin_safe": Byte( - 0, - ), - "has_skylight": Byte( - 1, - ), - "has_ceiling": Byte( - 1, - ), - "coordinate_scale": Double( - 1.0, - ), - "natural": Byte( - 1, - ), - }, - ), - }, - ), - ], - ), - }, - ), - "minecraft:worldgen/biome": Compound( - { - "value": List( - [ - Compound( - { - "id": Int( - 0, - ), - "element": Compound( - { - "downfall": Float( - 0.5, - ), - "temperature": Float( - 0.5, - ), - "effects": Compound( - { - "fog_color": Int( - 12638463, - ), - "sky_color": Int( - 8103167, - ), - "water_color": Int( - 4159204, - ), - "water_fog_color": Int( - 329011, - ), - "mood_sound": Compound( - { - "offset": Double( - 2.0, - ), - "block_search_extent": Int( - 8, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "tick_delay": Int( - 6000, - ), - }, - ), - }, - ), - "precipitation": String( - "none", - ), - }, - ), - "name": String( - "minecraft:the_void", - ), - }, - ), - Compound( - { - "name": String( - "minecraft:plains", - ), - "element": Compound( - { - "temperature": Float( - 0.8, - ), - "downfall": Float( - 0.4, - ), - "effects": Compound( - { - "sky_color": Int( - 7907327, - ), - "fog_color": Int( - 12638463, - ), - "water_fog_color": Int( - 329011, - ), - "water_color": Int( - 4159204, - ), - "mood_sound": Compound( - { - "sound": String( - "minecraft:ambient.cave", - ), - "tick_delay": Int( - 6000, - ), - "block_search_extent": Int( - 8, - ), - "offset": Double( - 2.0, - ), - }, - ), - }, - ), - "precipitation": String( - "rain", - ), - }, - ), - "id": Int( - 1, - ), - }, - ), - Compound( - { - "id": Int( - 2, - ), - "name": String( - "minecraft:sunflower_plains", - ), - "element": Compound( - { - "precipitation": String( - "rain", - ), - "effects": Compound( - { - "sky_color": Int( - 7907327, - ), - "water_fog_color": Int( - 329011, - ), - "water_color": Int( - 4159204, - ), - "fog_color": Int( - 12638463, - ), - "mood_sound": Compound( - { - "offset": Double( - 2.0, - ), - "tick_delay": Int( - 6000, - ), - "block_search_extent": Int( - 8, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - }, - ), - "downfall": Float( - 0.4, - ), - "temperature": Float( - 0.8, - ), - }, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:snowy_plains", - ), - "id": Int( - 3, - ), - "element": Compound( - { - "precipitation": String( - "snow", - ), - "effects": Compound( - { - "water_fog_color": Int( - 329011, - ), - "fog_color": Int( - 12638463, - ), - "sky_color": Int( - 8364543, - ), - "water_color": Int( - 4159204, - ), - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "block_search_extent": Int( - 8, - ), - }, - ), - }, - ), - "temperature": Float( - 0.0, - ), - "downfall": Float( - 0.5, - ), - }, - ), - }, - ), - Compound( - { - "id": Int( - 4, - ), - "name": String( - "minecraft:ice_spikes", - ), - "element": Compound( - { - "downfall": Float( - 0.5, - ), - "temperature": Float( - 0.0, - ), - "precipitation": String( - "snow", - ), - "effects": Compound( - { - "water_fog_color": Int( - 329011, - ), - "sky_color": Int( - 8364543, - ), - "fog_color": Int( - 12638463, - ), - "water_color": Int( - 4159204, - ), - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "block_search_extent": Int( - 8, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - }, - ), - }, - ), - }, - ), - Compound( - { - "element": Compound( - { - "temperature": Float( - 2.0, - ), - "effects": Compound( - { - "mood_sound": Compound( - { - "sound": String( - "minecraft:ambient.cave", - ), - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "block_search_extent": Int( - 8, - ), - }, - ), - "water_color": Int( - 4159204, - ), - "sky_color": Int( - 7254527, - ), - "fog_color": Int( - 12638463, - ), - "water_fog_color": Int( - 329011, - ), - }, - ), - "downfall": Float( - 0.0, - ), - "precipitation": String( - "none", - ), - }, - ), - "id": Int( - 5, - ), - "name": String( - "minecraft:desert", - ), - }, - ), - Compound( - { - "element": Compound( - { - "temperature": Float( - 0.8, - ), - "downfall": Float( - 0.9, - ), - "effects": Compound( - { - "foliage_color": Int( - 6975545, - ), - "water_color": Int( - 6388580, - ), - "music": Compound( - { - "replace_current_music": Byte( - 0, - ), - "max_delay": Int( - 24000, - ), - "min_delay": Int( - 12000, - ), - "sound": String( - "minecraft:music.overworld.swamp", - ), - }, - ), - "fog_color": Int( - 12638463, - ), - "grass_color_modifier": String( - "swamp", - ), - "mood_sound": Compound( - { - "offset": Double( - 2.0, - ), - "block_search_extent": Int( - 8, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "tick_delay": Int( - 6000, - ), - }, - ), - "sky_color": Int( - 7907327, - ), - "water_fog_color": Int( - 2302743, - ), - }, - ), - "precipitation": String( - "rain", - ), - }, - ), - "name": String( - "minecraft:swamp", - ), - "id": Int( - 6, - ), - }, - ), - Compound( - { - "id": Int( - 7, - ), - "name": String( - "minecraft:mangrove_swamp", - ), - "element": Compound( - { - "downfall": Float( - 0.9, - ), - "temperature": Float( - 0.8, - ), - "effects": Compound( - { - "foliage_color": Int( - 9285927, - ), - "grass_color_modifier": String( - "swamp", - ), - "water_color": Int( - 3832426, - ), - "sky_color": Int( - 7907327, - ), - "music": Compound( - { - "replace_current_music": Byte( - 0, - ), - "max_delay": Int( - 24000, - ), - "sound": String( - "minecraft:music.overworld.swamp", - ), - "min_delay": Int( - 12000, - ), - }, - ), - "fog_color": Int( - 12638463, - ), - "water_fog_color": Int( - 5077600, - ), - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "block_search_extent": Int( - 8, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - }, - ), - "precipitation": String( - "rain", - ), - }, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:forest", - ), - "element": Compound( - { - "temperature": Float( - 0.7, - ), - "downfall": Float( - 0.8, - ), - "precipitation": String( - "rain", - ), - "effects": Compound( - { - "water_fog_color": Int( - 329011, - ), - "water_color": Int( - 4159204, - ), - "fog_color": Int( - 12638463, - ), - "mood_sound": Compound( - { - "block_search_extent": Int( - 8, - ), - "offset": Double( - 2.0, - ), - "tick_delay": Int( - 6000, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - "sky_color": Int( - 7972607, - ), - "music": Compound( - { - "sound": String( - "minecraft:music.overworld.jungle_and_forest", - ), - "replace_current_music": Byte( - 0, - ), - "max_delay": Int( - 24000, - ), - "min_delay": Int( - 12000, - ), - }, - ), - }, - ), - }, - ), - "id": Int( - 8, - ), - }, - ), - Compound( - { - "element": Compound( - { - "downfall": Float( - 0.8, - ), - "temperature": Float( - 0.7, - ), - "effects": Compound( - { - "water_color": Int( - 4159204, - ), - "mood_sound": Compound( - { - "block_search_extent": Int( - 8, - ), - "offset": Double( - 2.0, - ), - "tick_delay": Int( - 6000, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - "water_fog_color": Int( - 329011, - ), - "sky_color": Int( - 7972607, - ), - "music": Compound( - { - "max_delay": Int( - 24000, - ), - "min_delay": Int( - 12000, - ), - "replace_current_music": Byte( - 0, - ), - "sound": String( - "minecraft:music.overworld.jungle_and_forest", - ), - }, - ), - "fog_color": Int( - 12638463, - ), - }, - ), - "precipitation": String( - "rain", - ), - }, - ), - "name": String( - "minecraft:flower_forest", - ), - "id": Int( - 9, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:birch_forest", - ), - "element": Compound( - { - "precipitation": String( - "rain", - ), - "downfall": Float( - 0.6, - ), - "effects": Compound( - { - "fog_color": Int( - 12638463, - ), - "sky_color": Int( - 8037887, - ), - "water_fog_color": Int( - 329011, - ), - "music": Compound( - { - "min_delay": Int( - 12000, - ), - "max_delay": Int( - 24000, - ), - "replace_current_music": Byte( - 0, - ), - "sound": String( - "minecraft:music.overworld.jungle_and_forest", - ), - }, - ), - "water_color": Int( - 4159204, - ), - "mood_sound": Compound( - { - "offset": Double( - 2.0, - ), - "block_search_extent": Int( - 8, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "tick_delay": Int( - 6000, - ), - }, - ), - }, - ), - "temperature": Float( - 0.6, - ), - }, - ), - "id": Int( - 10, - ), - }, - ), - Compound( - { - "element": Compound( - { - "effects": Compound( - { - "water_color": Int( - 4159204, - ), - "fog_color": Int( - 12638463, - ), - "music": Compound( - { - "max_delay": Int( - 24000, - ), - "replace_current_music": Byte( - 0, - ), - "min_delay": Int( - 12000, - ), - "sound": String( - "minecraft:music.overworld.jungle_and_forest", - ), - }, - ), - "sky_color": Int( - 7972607, - ), - "water_fog_color": Int( - 329011, - ), - "mood_sound": Compound( - { - "sound": String( - "minecraft:ambient.cave", - ), - "offset": Double( - 2.0, - ), - "tick_delay": Int( - 6000, - ), - "block_search_extent": Int( - 8, - ), - }, - ), - "grass_color_modifier": String( - "dark_forest", - ), - }, - ), - "precipitation": String( - "rain", - ), - "temperature": Float( - 0.7, - ), - "downfall": Float( - 0.8, - ), - }, - ), - "name": String( - "minecraft:dark_forest", - ), - "id": Int( - 11, - ), - }, - ), - Compound( - { - "id": Int( - 12, - ), - "name": String( - "minecraft:old_growth_birch_forest", - ), - "element": Compound( - { - "precipitation": String( - "rain", - ), - "temperature": Float( - 0.6, - ), - "downfall": Float( - 0.6, - ), - "effects": Compound( - { - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "block_search_extent": Int( - 8, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - "music": Compound( - { - "min_delay": Int( - 12000, - ), - "sound": String( - "minecraft:music.overworld.jungle_and_forest", - ), - "replace_current_music": Byte( - 0, - ), - "max_delay": Int( - 24000, - ), - }, - ), - "water_color": Int( - 4159204, - ), - "sky_color": Int( - 8037887, - ), - "fog_color": Int( - 12638463, - ), - "water_fog_color": Int( - 329011, - ), - }, - ), - }, - ), - }, - ), - Compound( - { - "id": Int( - 13, - ), - "name": String( - "minecraft:old_growth_pine_taiga", - ), - "element": Compound( - { - "temperature": Float( - 0.3, - ), - "precipitation": String( - "rain", - ), - "effects": Compound( - { - "water_fog_color": Int( - 329011, - ), - "fog_color": Int( - 12638463, - ), - "sky_color": Int( - 8168447, - ), - "music": Compound( - { - "min_delay": Int( - 12000, - ), - "replace_current_music": Byte( - 0, - ), - "max_delay": Int( - 24000, - ), - "sound": String( - "minecraft:music.overworld.old_growth_taiga", - ), - }, - ), - "water_color": Int( - 4159204, - ), - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "block_search_extent": Int( - 8, - ), - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - }, - ), - "downfall": Float( - 0.8, - ), - }, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:old_growth_spruce_taiga", - ), - "element": Compound( - { - "precipitation": String( - "rain", - ), - "effects": Compound( - { - "fog_color": Int( - 12638463, - ), - "mood_sound": Compound( - { - "sound": String( - "minecraft:ambient.cave", - ), - "offset": Double( - 2.0, - ), - "tick_delay": Int( - 6000, - ), - "block_search_extent": Int( - 8, - ), - }, - ), - "water_fog_color": Int( - 329011, - ), - "music": Compound( - { - "replace_current_music": Byte( - 0, - ), - "sound": String( - "minecraft:music.overworld.old_growth_taiga", - ), - "min_delay": Int( - 12000, - ), - "max_delay": Int( - 24000, - ), - }, - ), - "water_color": Int( - 4159204, - ), - "sky_color": Int( - 8233983, - ), - }, - ), - "temperature": Float( - 0.25, - ), - "downfall": Float( - 0.8, - ), - }, - ), - "id": Int( - 14, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:taiga", - ), - "id": Int( - 15, - ), - "element": Compound( - { - "temperature": Float( - 0.25, - ), - "downfall": Float( - 0.8, - ), - "precipitation": String( - "rain", - ), - "effects": Compound( - { - "water_color": Int( - 4159204, - ), - "water_fog_color": Int( - 329011, - ), - "fog_color": Int( - 12638463, - ), - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "block_search_extent": Int( - 8, - ), - }, - ), - "sky_color": Int( - 8233983, - ), - }, - ), - }, - ), - }, - ), - Compound( - { - "element": Compound( - { - "temperature": Float( - -0.5, - ), - "downfall": Float( - 0.4, - ), - "precipitation": String( - "snow", - ), - "effects": Compound( - { - "mood_sound": Compound( - { - "offset": Double( - 2.0, - ), - "block_search_extent": Int( - 8, - ), - "tick_delay": Int( - 6000, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - "water_color": Int( - 4020182, - ), - "sky_color": Int( - 8625919, - ), - "fog_color": Int( - 12638463, - ), - "water_fog_color": Int( - 329011, - ), - }, - ), - }, - ), - "id": Int( - 16, - ), - "name": String( - "minecraft:snowy_taiga", - ), - }, - ), - Compound( - { - "name": String( - "minecraft:savanna", - ), - "id": Int( - 17, - ), - "element": Compound( - { - "precipitation": String( - "none", - ), - "effects": Compound( - { - "water_color": Int( - 4159204, - ), - "fog_color": Int( - 12638463, - ), - "mood_sound": Compound( - { - "offset": Double( - 2.0, - ), - "tick_delay": Int( - 6000, - ), - "block_search_extent": Int( - 8, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - "sky_color": Int( - 7254527, - ), - "water_fog_color": Int( - 329011, - ), - }, - ), - "temperature": Float( - 2.0, - ), - "downfall": Float( - 0.0, - ), - }, - ), - }, - ), - Compound( - { - "element": Compound( - { - "precipitation": String( - "none", - ), - "downfall": Float( - 0.0, - ), - "temperature": Float( - 2.0, - ), - "effects": Compound( - { - "water_fog_color": Int( - 329011, - ), - "fog_color": Int( - 12638463, - ), - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "block_search_extent": Int( - 8, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - "water_color": Int( - 4159204, - ), - "sky_color": Int( - 7254527, - ), - }, - ), - }, - ), - "name": String( - "minecraft:savanna_plateau", - ), - "id": Int( - 18, - ), - }, - ), - Compound( - { - "element": Compound( - { - "temperature": Float( - 0.2, - ), - "effects": Compound( - { - "water_fog_color": Int( - 329011, - ), - "fog_color": Int( - 12638463, - ), - "water_color": Int( - 4159204, - ), - "sky_color": Int( - 8233727, - ), - "mood_sound": Compound( - { - "block_search_extent": Int( - 8, - ), - "offset": Double( - 2.0, - ), - "tick_delay": Int( - 6000, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - }, - ), - "downfall": Float( - 0.3, - ), - "precipitation": String( - "rain", - ), - }, - ), - "name": String( - "minecraft:windswept_hills", - ), - "id": Int( - 19, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:windswept_gravelly_hills", - ), - "id": Int( - 20, - ), - "element": Compound( - { - "precipitation": String( - "rain", - ), - "temperature": Float( - 0.2, - ), - "effects": Compound( - { - "water_fog_color": Int( - 329011, - ), - "fog_color": Int( - 12638463, - ), - "sky_color": Int( - 8233727, - ), - "water_color": Int( - 4159204, - ), - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "block_search_extent": Int( - 8, - ), - }, - ), - }, - ), - "downfall": Float( - 0.3, - ), - }, - ), - }, - ), - Compound( - { - "element": Compound( - { - "downfall": Float( - 0.3, - ), - "effects": Compound( - { - "water_color": Int( - 4159204, - ), - "water_fog_color": Int( - 329011, - ), - "sky_color": Int( - 8233727, - ), - "fog_color": Int( - 12638463, - ), - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "block_search_extent": Int( - 8, - ), - "offset": Double( - 2.0, - ), - }, - ), - }, - ), - "precipitation": String( - "rain", - ), - "temperature": Float( - 0.2, - ), - }, - ), - "id": Int( - 21, - ), - "name": String( - "minecraft:windswept_forest", - ), - }, - ), - Compound( - { - "id": Int( - 22, - ), - "name": String( - "minecraft:windswept_savanna", - ), - "element": Compound( - { - "precipitation": String( - "none", - ), - "effects": Compound( - { - "sky_color": Int( - 7254527, - ), - "fog_color": Int( - 12638463, - ), - "water_fog_color": Int( - 329011, - ), - "water_color": Int( - 4159204, - ), - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "block_search_extent": Int( - 8, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - }, - ), - "temperature": Float( - 2.0, - ), - "downfall": Float( - 0.0, - ), - }, - ), - }, - ), - Compound( - { - "id": Int( - 23, - ), - "name": String( - "minecraft:jungle", - ), - "element": Compound( - { - "downfall": Float( - 0.9, - ), - "precipitation": String( - "rain", - ), - "effects": Compound( - { - "water_fog_color": Int( - 329011, - ), - "water_color": Int( - 4159204, - ), - "music": Compound( - { - "sound": String( - "minecraft:music.overworld.jungle_and_forest", - ), - "max_delay": Int( - 24000, - ), - "replace_current_music": Byte( - 0, - ), - "min_delay": Int( - 12000, - ), - }, - ), - "sky_color": Int( - 7842047, - ), - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "block_search_extent": Int( - 8, - ), - }, - ), - "fog_color": Int( - 12638463, - ), - }, - ), - "temperature": Float( - 0.95, - ), - }, - ), - }, - ), - Compound( - { - "element": Compound( - { - "effects": Compound( - { - "mood_sound": Compound( - { - "offset": Double( - 2.0, - ), - "tick_delay": Int( - 6000, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "block_search_extent": Int( - 8, - ), - }, - ), - "music": Compound( - { - "replace_current_music": Byte( - 0, - ), - "max_delay": Int( - 24000, - ), - "min_delay": Int( - 12000, - ), - "sound": String( - "minecraft:music.overworld.jungle_and_forest", - ), - }, - ), - "water_fog_color": Int( - 329011, - ), - "sky_color": Int( - 7842047, - ), - "fog_color": Int( - 12638463, - ), - "water_color": Int( - 4159204, - ), - }, - ), - "downfall": Float( - 0.8, - ), - "temperature": Float( - 0.95, - ), - "precipitation": String( - "rain", - ), - }, - ), - "name": String( - "minecraft:sparse_jungle", - ), - "id": Int( - 24, - ), - }, - ), - Compound( - { - "element": Compound( - { - "downfall": Float( - 0.9, - ), - "temperature": Float( - 0.95, - ), - "effects": Compound( - { - "music": Compound( - { - "sound": String( - "minecraft:music.overworld.jungle_and_forest", - ), - "min_delay": Int( - 12000, - ), - "replace_current_music": Byte( - 0, - ), - "max_delay": Int( - 24000, - ), - }, - ), - "fog_color": Int( - 12638463, - ), - "mood_sound": Compound( - { - "sound": String( - "minecraft:ambient.cave", - ), - "offset": Double( - 2.0, - ), - "tick_delay": Int( - 6000, - ), - "block_search_extent": Int( - 8, - ), - }, - ), - "sky_color": Int( - 7842047, - ), - "water_fog_color": Int( - 329011, - ), - "water_color": Int( - 4159204, - ), - }, - ), - "precipitation": String( - "rain", - ), - }, - ), - "name": String( - "minecraft:bamboo_jungle", - ), - "id": Int( - 25, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:badlands", - ), - "id": Int( - 26, - ), - "element": Compound( - { - "temperature": Float( - 2.0, - ), - "downfall": Float( - 0.0, - ), - "precipitation": String( - "none", - ), - "effects": Compound( - { - "water_color": Int( - 4159204, - ), - "foliage_color": Int( - 10387789, - ), - "grass_color": Int( - 9470285, - ), - "fog_color": Int( - 12638463, - ), - "water_fog_color": Int( - 329011, - ), - "mood_sound": Compound( - { - "sound": String( - "minecraft:ambient.cave", - ), - "tick_delay": Int( - 6000, - ), - "block_search_extent": Int( - 8, - ), - "offset": Double( - 2.0, - ), - }, - ), - "sky_color": Int( - 7254527, - ), - }, - ), - }, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:eroded_badlands", - ), - "id": Int( - 27, - ), - "element": Compound( - { - "precipitation": String( - "none", - ), - "downfall": Float( - 0.0, - ), - "effects": Compound( - { - "foliage_color": Int( - 10387789, - ), - "sky_color": Int( - 7254527, - ), - "water_color": Int( - 4159204, - ), - "water_fog_color": Int( - 329011, - ), - "grass_color": Int( - 9470285, - ), - "mood_sound": Compound( - { - "block_search_extent": Int( - 8, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "offset": Double( - 2.0, - ), - "tick_delay": Int( - 6000, - ), - }, - ), - "fog_color": Int( - 12638463, - ), - }, - ), - "temperature": Float( - 2.0, - ), - }, - ), - }, - ), - Compound( - { - "id": Int( - 28, - ), - "element": Compound( - { - "temperature": Float( - 2.0, - ), - "downfall": Float( - 0.0, - ), - "precipitation": String( - "none", - ), - "effects": Compound( - { - "sky_color": Int( - 7254527, - ), - "grass_color": Int( - 9470285, - ), - "water_fog_color": Int( - 329011, - ), - "mood_sound": Compound( - { - "sound": String( - "minecraft:ambient.cave", - ), - "offset": Double( - 2.0, - ), - "block_search_extent": Int( - 8, - ), - "tick_delay": Int( - 6000, - ), - }, - ), - "water_color": Int( - 4159204, - ), - "fog_color": Int( - 12638463, - ), - "foliage_color": Int( - 10387789, - ), - }, - ), - }, - ), - "name": String( - "minecraft:wooded_badlands", - ), - }, - ), - Compound( - { - "name": String( - "minecraft:meadow", - ), - "id": Int( - 29, - ), - "element": Compound( - { - "temperature": Float( - 0.5, - ), - "precipitation": String( - "rain", - ), - "downfall": Float( - 0.8, - ), - "effects": Compound( - { - "water_color": Int( - 937679, - ), - "water_fog_color": Int( - 329011, - ), - "music": Compound( - { - "replace_current_music": Byte( - 0, - ), - "min_delay": Int( - 12000, - ), - "sound": String( - "minecraft:music.overworld.meadow", - ), - "max_delay": Int( - 24000, - ), - }, - ), - "sky_color": Int( - 8103167, - ), - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "block_search_extent": Int( - 8, - ), - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - "fog_color": Int( - 12638463, - ), - }, - ), - }, - ), - }, - ), - Compound( - { - "element": Compound( - { - "precipitation": String( - "snow", - ), - "temperature": Float( - -0.2, - ), - "effects": Compound( - { - "water_color": Int( - 4159204, - ), - "mood_sound": Compound( - { - "offset": Double( - 2.0, - ), - "block_search_extent": Int( - 8, - ), - "tick_delay": Int( - 6000, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - "sky_color": Int( - 8495359, - ), - "music": Compound( - { - "max_delay": Int( - 24000, - ), - "min_delay": Int( - 12000, - ), - "sound": String( - "minecraft:music.overworld.grove", - ), - "replace_current_music": Byte( - 0, - ), - }, - ), - "fog_color": Int( - 12638463, - ), - "water_fog_color": Int( - 329011, - ), - }, - ), - "downfall": Float( - 0.8, - ), - }, - ), - "name": String( - "minecraft:grove", - ), - "id": Int( - 30, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:snowy_slopes", - ), - "element": Compound( - { - "temperature": Float( - -0.3, - ), - "downfall": Float( - 0.9, - ), - "precipitation": String( - "snow", - ), - "effects": Compound( - { - "water_fog_color": Int( - 329011, - ), - "fog_color": Int( - 12638463, - ), - "music": Compound( - { - "max_delay": Int( - 24000, - ), - "sound": String( - "minecraft:music.overworld.snowy_slopes", - ), - "min_delay": Int( - 12000, - ), - "replace_current_music": Byte( - 0, - ), - }, - ), - "sky_color": Int( - 8560639, - ), - "water_color": Int( - 4159204, - ), - "mood_sound": Compound( - { - "block_search_extent": Int( - 8, - ), - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - }, - ), - }, - ), - "id": Int( - 31, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:frozen_peaks", - ), - "element": Compound( - { - "effects": Compound( - { - "music": Compound( - { - "replace_current_music": Byte( - 0, - ), - "max_delay": Int( - 24000, - ), - "min_delay": Int( - 12000, - ), - "sound": String( - "minecraft:music.overworld.frozen_peaks", - ), - }, - ), - "fog_color": Int( - 12638463, - ), - "sky_color": Int( - 8756735, - ), - "water_fog_color": Int( - 329011, - ), - "water_color": Int( - 4159204, - ), - "mood_sound": Compound( - { - "sound": String( - "minecraft:ambient.cave", - ), - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "block_search_extent": Int( - 8, - ), - }, - ), - }, - ), - "temperature": Float( - -0.7, - ), - "precipitation": String( - "snow", - ), - "downfall": Float( - 0.9, - ), - }, - ), - "id": Int( - 32, - ), - }, - ), - Compound( - { - "element": Compound( - { - "temperature": Float( - -0.7, - ), - "downfall": Float( - 0.9, - ), - "effects": Compound( - { - "mood_sound": Compound( - { - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "tick_delay": Int( - 6000, - ), - "block_search_extent": Int( - 8, - ), - }, - ), - "fog_color": Int( - 12638463, - ), - "music": Compound( - { - "min_delay": Int( - 12000, - ), - "max_delay": Int( - 24000, - ), - "sound": String( - "minecraft:music.overworld.jagged_peaks", - ), - "replace_current_music": Byte( - 0, - ), - }, - ), - "water_color": Int( - 4159204, - ), - "sky_color": Int( - 8756735, - ), - "water_fog_color": Int( - 329011, - ), - }, - ), - "precipitation": String( - "snow", - ), - }, - ), - "id": Int( - 33, - ), - "name": String( - "minecraft:jagged_peaks", - ), - }, - ), - Compound( - { - "element": Compound( - { - "downfall": Float( - 0.3, - ), - "effects": Compound( - { - "music": Compound( - { - "min_delay": Int( - 12000, - ), - "replace_current_music": Byte( - 0, - ), - "sound": String( - "minecraft:music.overworld.stony_peaks", - ), - "max_delay": Int( - 24000, - ), - }, - ), - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "block_search_extent": Int( - 8, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - "sky_color": Int( - 7776511, - ), - "water_color": Int( - 4159204, - ), - "fog_color": Int( - 12638463, - ), - "water_fog_color": Int( - 329011, - ), - }, - ), - "temperature": Float( - 1.0, - ), - "precipitation": String( - "rain", - ), - }, - ), - "name": String( - "minecraft:stony_peaks", - ), - "id": Int( - 34, - ), - }, - ), - Compound( - { - "id": Int( - 35, - ), - "element": Compound( - { - "effects": Compound( - { - "sky_color": Int( - 8103167, - ), - "fog_color": Int( - 12638463, - ), - "water_color": Int( - 4159204, - ), - "water_fog_color": Int( - 329011, - ), - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "block_search_extent": Int( - 8, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "offset": Double( - 2.0, - ), - }, - ), - }, - ), - "temperature": Float( - 0.5, - ), - "precipitation": String( - "rain", - ), - "downfall": Float( - 0.5, - ), - }, - ), - "name": String( - "minecraft:river", - ), - }, - ), - Compound( - { - "id": Int( - 36, - ), - "element": Compound( - { - "downfall": Float( - 0.5, - ), - "temperature": Float( - 0.0, - ), - "precipitation": String( - "snow", - ), - "effects": Compound( - { - "water_fog_color": Int( - 329011, - ), - "water_color": Int( - 3750089, - ), - "mood_sound": Compound( - { - "offset": Double( - 2.0, - ), - "block_search_extent": Int( - 8, - ), - "tick_delay": Int( - 6000, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - "fog_color": Int( - 12638463, - ), - "sky_color": Int( - 8364543, - ), - }, - ), - }, - ), - "name": String( - "minecraft:frozen_river", - ), - }, - ), - Compound( - { - "element": Compound( - { - "downfall": Float( - 0.4, - ), - "precipitation": String( - "rain", - ), - "effects": Compound( - { - "mood_sound": Compound( - { - "sound": String( - "minecraft:ambient.cave", - ), - "block_search_extent": Int( - 8, - ), - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - }, - ), - "sky_color": Int( - 7907327, - ), - "water_color": Int( - 4159204, - ), - "water_fog_color": Int( - 329011, - ), - "fog_color": Int( - 12638463, - ), - }, - ), - "temperature": Float( - 0.8, - ), - }, - ), - "name": String( - "minecraft:beach", - ), - "id": Int( - 37, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:snowy_beach", - ), - "element": Compound( - { - "effects": Compound( - { - "sky_color": Int( - 8364543, - ), - "fog_color": Int( - 12638463, - ), - "mood_sound": Compound( - { - "block_search_extent": Int( - 8, - ), - "offset": Double( - 2.0, - ), - "tick_delay": Int( - 6000, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - "water_fog_color": Int( - 329011, - ), - "water_color": Int( - 4020182, - ), - }, - ), - "downfall": Float( - 0.3, - ), - "precipitation": String( - "snow", - ), - "temperature": Float( - 0.05, - ), - }, - ), - "id": Int( - 38, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:stony_shore", - ), - "id": Int( - 39, - ), - "element": Compound( - { - "precipitation": String( - "rain", - ), - "temperature": Float( - 0.2, - ), - "effects": Compound( - { - "water_fog_color": Int( - 329011, - ), - "fog_color": Int( - 12638463, - ), - "mood_sound": Compound( - { - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "block_search_extent": Int( - 8, - ), - "tick_delay": Int( - 6000, - ), - }, - ), - "sky_color": Int( - 8233727, - ), - "water_color": Int( - 4159204, - ), - }, - ), - "downfall": Float( - 0.3, - ), - }, - ), - }, - ), - Compound( - { - "id": Int( - 40, - ), - "name": String( - "minecraft:warm_ocean", - ), - "element": Compound( - { - "temperature": Float( - 0.5, - ), - "effects": Compound( - { - "sky_color": Int( - 8103167, - ), - "water_color": Int( - 4445678, - ), - "water_fog_color": Int( - 270131, - ), - "mood_sound": Compound( - { - "sound": String( - "minecraft:ambient.cave", - ), - "block_search_extent": Int( - 8, - ), - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - }, - ), - "fog_color": Int( - 12638463, - ), - }, - ), - "precipitation": String( - "rain", - ), - "downfall": Float( - 0.5, - ), - }, - ), - }, - ), - Compound( - { - "element": Compound( - { - "temperature": Float( - 0.5, - ), - "downfall": Float( - 0.5, - ), - "precipitation": String( - "rain", - ), - "effects": Compound( - { - "water_fog_color": Int( - 267827, - ), - "sky_color": Int( - 8103167, - ), - "fog_color": Int( - 12638463, - ), - "water_color": Int( - 4566514, - ), - "mood_sound": Compound( - { - "block_search_extent": Int( - 8, - ), - "tick_delay": Int( - 6000, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "offset": Double( - 2.0, - ), - }, - ), - }, - ), - }, - ), - "name": String( - "minecraft:lukewarm_ocean", - ), - "id": Int( - 41, - ), - }, - ), - Compound( - { - "element": Compound( - { - "effects": Compound( - { - "fog_color": Int( - 12638463, - ), - "sky_color": Int( - 8103167, - ), - "water_color": Int( - 4566514, - ), - "water_fog_color": Int( - 267827, - ), - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "block_search_extent": Int( - 8, - ), - "offset": Double( - 2.0, - ), - }, - ), - }, - ), - "precipitation": String( - "rain", - ), - "temperature": Float( - 0.5, - ), - "downfall": Float( - 0.5, - ), - }, - ), - "id": Int( - 42, - ), - "name": String( - "minecraft:deep_lukewarm_ocean", - ), - }, - ), - Compound( - { - "name": String( - "minecraft:ocean", - ), - "id": Int( - 43, - ), - "element": Compound( - { - "downfall": Float( - 0.5, - ), - "effects": Compound( - { - "water_color": Int( - 4159204, - ), - "sky_color": Int( - 8103167, - ), - "mood_sound": Compound( - { - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "block_search_extent": Int( - 8, - ), - "tick_delay": Int( - 6000, - ), - }, - ), - "water_fog_color": Int( - 329011, - ), - "fog_color": Int( - 12638463, - ), - }, - ), - "precipitation": String( - "rain", - ), - "temperature": Float( - 0.5, - ), - }, - ), - }, - ), - Compound( - { - "id": Int( - 44, - ), - "name": String( - "minecraft:deep_ocean", - ), - "element": Compound( - { - "effects": Compound( - { - "fog_color": Int( - 12638463, - ), - "water_color": Int( - 4159204, - ), - "sky_color": Int( - 8103167, - ), - "mood_sound": Compound( - { - "block_search_extent": Int( - 8, - ), - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - "water_fog_color": Int( - 329011, - ), - }, - ), - "precipitation": String( - "rain", - ), - "temperature": Float( - 0.5, - ), - "downfall": Float( - 0.5, - ), - }, - ), - }, - ), - Compound( - { - "element": Compound( - { - "precipitation": String( - "rain", - ), - "effects": Compound( - { - "water_color": Int( - 4020182, - ), - "fog_color": Int( - 12638463, - ), - "sky_color": Int( - 8103167, - ), - "water_fog_color": Int( - 329011, - ), - "mood_sound": Compound( - { - "sound": String( - "minecraft:ambient.cave", - ), - "offset": Double( - 2.0, - ), - "block_search_extent": Int( - 8, - ), - "tick_delay": Int( - 6000, - ), - }, - ), - }, - ), - "temperature": Float( - 0.5, - ), - "downfall": Float( - 0.5, - ), - }, - ), - "name": String( - "minecraft:cold_ocean", - ), - "id": Int( - 45, - ), - }, - ), - Compound( - { - "id": Int( - 46, - ), - "name": String( - "minecraft:deep_cold_ocean", - ), - "element": Compound( - { - "downfall": Float( - 0.5, - ), - "precipitation": String( - "rain", - ), - "effects": Compound( - { - "water_fog_color": Int( - 329011, - ), - "fog_color": Int( - 12638463, - ), - "sky_color": Int( - 8103167, - ), - "mood_sound": Compound( - { - "block_search_extent": Int( - 8, - ), - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - "water_color": Int( - 4020182, - ), - }, - ), - "temperature": Float( - 0.5, - ), - }, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:frozen_ocean", - ), - "id": Int( - 47, - ), - "element": Compound( - { - "temperature_modifier": String( - "frozen", - ), - "precipitation": String( - "snow", - ), - "effects": Compound( - { - "sky_color": Int( - 8364543, - ), - "fog_color": Int( - 12638463, - ), - "water_fog_color": Int( - 329011, - ), - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "block_search_extent": Int( - 8, - ), - }, - ), - "water_color": Int( - 3750089, - ), - }, - ), - "temperature": Float( - 0.0, - ), - "downfall": Float( - 0.5, - ), - }, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:deep_frozen_ocean", - ), - "element": Compound( - { - "downfall": Float( - 0.5, - ), - "effects": Compound( - { - "fog_color": Int( - 12638463, - ), - "water_color": Int( - 3750089, - ), - "sky_color": Int( - 8103167, - ), - "water_fog_color": Int( - 329011, - ), - "mood_sound": Compound( - { - "block_search_extent": Int( - 8, - ), - "tick_delay": Int( - 6000, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "offset": Double( - 2.0, - ), - }, - ), - }, - ), - "temperature_modifier": String( - "frozen", - ), - "temperature": Float( - 0.5, - ), - "precipitation": String( - "rain", - ), - }, - ), - "id": Int( - 48, - ), - }, - ), - Compound( - { - "element": Compound( - { - "precipitation": String( - "rain", - ), - "effects": Compound( - { - "mood_sound": Compound( - { - "sound": String( - "minecraft:ambient.cave", - ), - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "block_search_extent": Int( - 8, - ), - }, - ), - "sky_color": Int( - 7842047, - ), - "fog_color": Int( - 12638463, - ), - "water_color": Int( - 4159204, - ), - "water_fog_color": Int( - 329011, - ), - }, - ), - "downfall": Float( - 1.0, - ), - "temperature": Float( - 0.9, - ), - }, - ), - "name": String( - "minecraft:mushroom_fields", - ), - "id": Int( - 49, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:dripstone_caves", - ), - "id": Int( - 50, - ), - "element": Compound( - { - "downfall": Float( - 0.4, - ), - "precipitation": String( - "rain", - ), - "effects": Compound( - { - "fog_color": Int( - 12638463, - ), - "sky_color": Int( - 7907327, - ), - "mood_sound": Compound( - { - "block_search_extent": Int( - 8, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "offset": Double( - 2.0, - ), - "tick_delay": Int( - 6000, - ), - }, - ), - "water_fog_color": Int( - 329011, - ), - "music": Compound( - { - "sound": String( - "minecraft:music.overworld.dripstone_caves", - ), - "replace_current_music": Byte( - 0, - ), - "max_delay": Int( - 24000, - ), - "min_delay": Int( - 12000, - ), - }, - ), - "water_color": Int( - 4159204, - ), - }, - ), - "temperature": Float( - 0.8, - ), - }, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:lush_caves", - ), - "element": Compound( - { - "precipitation": String( - "rain", - ), - "effects": Compound( - { - "water_fog_color": Int( - 329011, - ), - "fog_color": Int( - 12638463, - ), - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "block_search_extent": Int( - 8, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - "water_color": Int( - 4159204, - ), - "sky_color": Int( - 8103167, - ), - "music": Compound( - { - "min_delay": Int( - 12000, - ), - "sound": String( - "minecraft:music.overworld.lush_caves", - ), - "replace_current_music": Byte( - 0, - ), - "max_delay": Int( - 24000, - ), - }, - ), - }, - ), - "temperature": Float( - 0.5, - ), - "downfall": Float( - 0.5, - ), - }, - ), - "id": Int( - 51, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:deep_dark", - ), - "id": Int( - 52, - ), - "element": Compound( - { - "effects": Compound( - { - "sky_color": Int( - 7907327, - ), - "mood_sound": Compound( - { - "offset": Double( - 2.0, - ), - "tick_delay": Int( - 6000, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "block_search_extent": Int( - 8, - ), - }, - ), - "music": Compound( - { - "max_delay": Int( - 24000, - ), - "replace_current_music": Byte( - 0, - ), - "sound": String( - "minecraft:music.overworld.deep_dark", - ), - "min_delay": Int( - 12000, - ), - }, - ), - "water_color": Int( - 4159204, - ), - "water_fog_color": Int( - 329011, - ), - "fog_color": Int( - 12638463, - ), - }, - ), - "downfall": Float( - 0.4, - ), - "precipitation": String( - "rain", - ), - "temperature": Float( - 0.8, - ), - }, - ), - }, - ), - Compound( - { - "id": Int( - 53, - ), - "name": String( - "minecraft:nether_wastes", - ), - "element": Compound( - { - "temperature": Float( - 2.0, - ), - "precipitation": String( - "none", - ), - "downfall": Float( - 0.0, - ), - "effects": Compound( - { - "mood_sound": Compound( - { - "sound": String( - "minecraft:ambient.nether_wastes.mood", - ), - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "block_search_extent": Int( - 8, - ), - }, - ), - "water_fog_color": Int( - 329011, - ), - "water_color": Int( - 4159204, - ), - "fog_color": Int( - 3344392, - ), - "music": Compound( - { - "min_delay": Int( - 12000, - ), - "max_delay": Int( - 24000, - ), - "sound": String( - "minecraft:music.nether.nether_wastes", - ), - "replace_current_music": Byte( - 0, - ), - }, - ), - "sky_color": Int( - 7254527, - ), - "ambient_sound": String( - "minecraft:ambient.nether_wastes.loop", - ), - "additions_sound": Compound( - { - "tick_chance": Double( - 0.0111, - ), - "sound": String( - "minecraft:ambient.nether_wastes.additions", - ), - }, - ), - }, - ), - }, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:warped_forest", - ), - "element": Compound( - { - "temperature": Float( - 2.0, - ), - "precipitation": String( - "none", - ), - "effects": Compound( - { - "additions_sound": Compound( - { - "tick_chance": Double( - 0.0111, - ), - "sound": String( - "minecraft:ambient.warped_forest.additions", - ), - }, - ), - "fog_color": Int( - 1705242, - ), - "music": Compound( - { - "replace_current_music": Byte( - 0, - ), - "max_delay": Int( - 24000, - ), - "min_delay": Int( - 12000, - ), - "sound": String( - "minecraft:music.nether.warped_forest", - ), - }, - ), - "ambient_sound": String( - "minecraft:ambient.warped_forest.loop", - ), - "particle": Compound( - { - "options": Compound( - { - "type": String( - "minecraft:warped_spore", - ), - }, - ), - "probability": Float( - 0.01428, - ), - }, - ), - "water_fog_color": Int( - 329011, - ), - "mood_sound": Compound( - { - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.warped_forest.mood", - ), - "tick_delay": Int( - 6000, - ), - "block_search_extent": Int( - 8, - ), - }, - ), - "sky_color": Int( - 7254527, - ), - "water_color": Int( - 4159204, - ), - }, - ), - "downfall": Float( - 0.0, - ), - }, - ), - "id": Int( - 54, - ), - }, - ), - Compound( - { - "id": Int( - 55, - ), - "name": String( - "minecraft:crimson_forest", - ), - "element": Compound( - { - "temperature": Float( - 2.0, - ), - "precipitation": String( - "none", - ), - "effects": Compound( - { - "additions_sound": Compound( - { - "tick_chance": Double( - 0.0111, - ), - "sound": String( - "minecraft:ambient.crimson_forest.additions", - ), - }, - ), - "particle": Compound( - { - "options": Compound( - { - "type": String( - "minecraft:crimson_spore", - ), - }, - ), - "probability": Float( - 0.025, - ), - }, - ), - "water_fog_color": Int( - 329011, - ), - "music": Compound( - { - "sound": String( - "minecraft:music.nether.crimson_forest", - ), - "min_delay": Int( - 12000, - ), - "replace_current_music": Byte( - 0, - ), - "max_delay": Int( - 24000, - ), - }, - ), - "fog_color": Int( - 3343107, - ), - "sky_color": Int( - 7254527, - ), - "ambient_sound": String( - "minecraft:ambient.crimson_forest.loop", - ), - "water_color": Int( - 4159204, - ), - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.crimson_forest.mood", - ), - "block_search_extent": Int( - 8, - ), - }, - ), - }, - ), - "downfall": Float( - 0.0, - ), - }, - ), - }, - ), - Compound( - { - "id": Int( - 56, - ), - "name": String( - "minecraft:soul_sand_valley", - ), - "element": Compound( - { - "effects": Compound( - { - "fog_color": Int( - 1787717, - ), - "water_color": Int( - 4159204, - ), - "mood_sound": Compound( - { - "sound": String( - "minecraft:ambient.soul_sand_valley.mood", - ), - "block_search_extent": Int( - 8, - ), - "offset": Double( - 2.0, - ), - "tick_delay": Int( - 6000, - ), - }, - ), - "additions_sound": Compound( - { - "sound": String( - "minecraft:ambient.soul_sand_valley.additions", - ), - "tick_chance": Double( - 0.0111, - ), - }, - ), - "ambient_sound": String( - "minecraft:ambient.soul_sand_valley.loop", - ), - "music": Compound( - { - "sound": String( - "minecraft:music.nether.soul_sand_valley", - ), - "min_delay": Int( - 12000, - ), - "replace_current_music": Byte( - 0, - ), - "max_delay": Int( - 24000, - ), - }, - ), - "water_fog_color": Int( - 329011, - ), - "particle": Compound( - { - "probability": Float( - 0.00625, - ), - "options": Compound( - { - "type": String( - "minecraft:ash", - ), - }, - ), - }, - ), - "sky_color": Int( - 7254527, - ), - }, - ), - "downfall": Float( - 0.0, - ), - "temperature": Float( - 2.0, - ), - "precipitation": String( - "none", - ), - }, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:basalt_deltas", - ), - "id": Int( - 57, - ), - "element": Compound( - { - "downfall": Float( - 0.0, - ), - "temperature": Float( - 2.0, - ), - "precipitation": String( - "none", - ), - "effects": Compound( - { - "fog_color": Int( - 6840176, - ), - "mood_sound": Compound( - { - "sound": String( - "minecraft:ambient.basalt_deltas.mood", - ), - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "block_search_extent": Int( - 8, - ), - }, - ), - "ambient_sound": String( - "minecraft:ambient.basalt_deltas.loop", - ), - "water_fog_color": Int( - 329011, - ), - "sky_color": Int( - 7254527, - ), - "particle": Compound( - { - "options": Compound( - { - "type": String( - "minecraft:white_ash", - ), - }, - ), - "probability": Float( - 0.118093334, - ), - }, - ), - "music": Compound( - { - "sound": String( - "minecraft:music.nether.basalt_deltas", - ), - "min_delay": Int( - 12000, - ), - "replace_current_music": Byte( - 0, - ), - "max_delay": Int( - 24000, - ), - }, - ), - "water_color": Int( - 4159204, - ), - "additions_sound": Compound( - { - "tick_chance": Double( - 0.0111, - ), - "sound": String( - "minecraft:ambient.basalt_deltas.additions", - ), - }, - ), - }, - ), - }, - ), - }, - ), - Compound( - { - "element": Compound( - { - "effects": Compound( - { - "sky_color": Int( - 0, - ), - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "block_search_extent": Int( - 8, - ), - }, - ), - "water_fog_color": Int( - 329011, - ), - "water_color": Int( - 4159204, - ), - "fog_color": Int( - 10518688, - ), - }, - ), - "temperature": Float( - 0.5, - ), - "precipitation": String( - "none", - ), - "downfall": Float( - 0.5, - ), - }, - ), - "id": Int( - 58, - ), - "name": String( - "minecraft:the_end", - ), - }, - ), - Compound( - { - "element": Compound( - { - "effects": Compound( - { - "fog_color": Int( - 10518688, - ), - "water_color": Int( - 4159204, - ), - "mood_sound": Compound( - { - "block_search_extent": Int( - 8, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - }, - ), - "water_fog_color": Int( - 329011, - ), - "sky_color": Int( - 0, - ), - }, - ), - "downfall": Float( - 0.5, - ), - "temperature": Float( - 0.5, - ), - "precipitation": String( - "none", - ), - }, - ), - "name": String( - "minecraft:end_highlands", - ), - "id": Int( - 59, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:end_midlands", - ), - "element": Compound( - { - "temperature": Float( - 0.5, - ), - "precipitation": String( - "none", - ), - "effects": Compound( - { - "water_fog_color": Int( - 329011, - ), - "water_color": Int( - 4159204, - ), - "fog_color": Int( - 10518688, - ), - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "block_search_extent": Int( - 8, - ), - "offset": Double( - 2.0, - ), - }, - ), - "sky_color": Int( - 0, - ), - }, - ), - "downfall": Float( - 0.5, - ), - }, - ), - "id": Int( - 60, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:small_end_islands", - ), - "id": Int( - 61, - ), - "element": Compound( - { - "effects": Compound( - { - "water_color": Int( - 4159204, - ), - "sky_color": Int( - 0, - ), - "fog_color": Int( - 10518688, - ), - "water_fog_color": Int( - 329011, - ), - "mood_sound": Compound( - { - "block_search_extent": Int( - 8, - ), - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.cave", - ), - }, - ), - }, - ), - "precipitation": String( - "none", - ), - "downfall": Float( - 0.5, - ), - "temperature": Float( - 0.5, - ), - }, - ), - }, - ), - Compound( - { - "element": Compound( - { - "temperature": Float( - 0.5, - ), - "precipitation": String( - "none", - ), - "effects": Compound( - { - "sky_color": Int( - 0, - ), - "water_fog_color": Int( - 329011, - ), - "fog_color": Int( - 10518688, - ), - "water_color": Int( - 4159204, - ), - "mood_sound": Compound( - { - "tick_delay": Int( - 6000, - ), - "offset": Double( - 2.0, - ), - "sound": String( - "minecraft:ambient.cave", - ), - "block_search_extent": Int( - 8, - ), - }, - ), - }, - ), - "downfall": Float( - 0.5, - ), - }, - ), - "name": String( - "minecraft:end_barrens", - ), - "id": Int( - 62, - ), - }, - ), - ], - ), - "type": String( - "minecraft:worldgen/biome", - ), - }, - ), - "minecraft:chat_type": Compound( - { - "value": List( - [ - Compound( - { - "name": String( - "minecraft:chat", - ), - "id": Int( - 0, - ), - "element": Compound( - { - "chat": Compound( - { - "decoration": Compound( - { - "style": Compound( - {}, - ), - "translation_key": String( - "chat.type.text", - ), - "parameters": List( - [ - String( - "sender", - ), - String( - "content", - ), - ], - ), - }, - ), - }, - ), - "narration": Compound( - { - "priority": String( - "chat", - ), - "decoration": Compound( - { - "parameters": List( - [ - String( - "sender", - ), - String( - "content", - ), - ], - ), - "translation_key": String( - "chat.type.text.narrate", - ), - "style": Compound( - {}, - ), - }, - ), - }, - ), - }, - ), - }, - ), - Compound( - { - "id": Int( - 1, - ), - "name": String( - "minecraft:system", - ), - "element": Compound( - { - "narration": Compound( - { - "priority": String( - "system", - ), - }, - ), - "chat": Compound( - {}, - ), - }, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:game_info", - ), - "id": Int( - 2, - ), - "element": Compound( - { - "overlay": Compound( - {}, - ), - }, - ), - }, - ), - Compound( - { - "element": Compound( - { - "chat": Compound( - { - "decoration": Compound( - { - "translation_key": String( - "chat.type.announcement", - ), - "style": Compound( - {}, - ), - "parameters": List( - [ - String( - "sender", - ), - String( - "content", - ), - ], - ), - }, - ), - }, - ), - "narration": Compound( - { - "decoration": Compound( - { - "style": Compound( - {}, - ), - "translation_key": String( - "chat.type.text.narrate", - ), - "parameters": List( - [ - String( - "sender", - ), - String( - "content", - ), - ], - ), - }, - ), - "priority": String( - "chat", - ), - }, - ), - }, - ), - "name": String( - "minecraft:say_command", - ), - "id": Int( - 3, - ), - }, - ), - Compound( - { - "name": String( - "minecraft:msg_command", - ), - "id": Int( - 4, - ), - "element": Compound( - { - "chat": Compound( - { - "decoration": Compound( - { - "style": Compound( - { - "italic": Byte( - 1, - ), - "color": String( - "gray", - ), - }, - ), - "parameters": List( - [ - String( - "sender", - ), - String( - "content", - ), - ], - ), - "translation_key": String( - "commands.message.display.incoming", - ), - }, - ), - }, - ), - "narration": Compound( - { - "decoration": Compound( - { - "parameters": List( - [ - String( - "sender", - ), - String( - "content", - ), - ], - ), - "translation_key": String( - "chat.type.text.narrate", - ), - "style": Compound( - {}, - ), - }, - ), - "priority": String( - "chat", - ), - }, - ), - }, - ), - }, - ), - Compound( - { - "element": Compound( - { - "chat": Compound( - { - "decoration": Compound( - { - "translation_key": String( - "chat.type.team.text", - ), - "parameters": List( - [ - String( - "team_name", - ), - String( - "sender", - ), - String( - "content", - ), - ], - ), - "style": Compound( - {}, - ), - }, - ), - }, - ), - "narration": Compound( - { - "decoration": Compound( - { - "style": Compound( - {}, - ), - "translation_key": String( - "chat.type.text.narrate", - ), - "parameters": List( - [ - String( - "sender", - ), - String( - "content", - ), - ], - ), - }, - ), - "priority": String( - "chat", - ), - }, - ), - }, - ), - "id": Int( - 5, - ), - "name": String( - "minecraft:team_msg_command", - ), - }, - ), - Compound( - { - "element": Compound( - { - "chat": Compound( - { - "decoration": Compound( - { - "parameters": List( - [ - String( - "sender", - ), - String( - "content", - ), - ], - ), - "translation_key": String( - "chat.type.emote", - ), - "style": Compound( - {}, - ), - }, - ), - }, - ), - "narration": Compound( - { - "priority": String( - "chat", - ), - "decoration": Compound( - { - "style": Compound( - {}, - ), - "translation_key": String( - "chat.type.emote", - ), - "parameters": List( - [ - String( - "sender", - ), - String( - "content", - ), - ], - ), - }, - ), - }, - ), - }, - ), - "name": String( - "minecraft:emote_command", - ), - "id": Int( - 6, - ), - }, - ), - Compound( - { - "id": Int( - 7, - ), - "element": Compound( - { - "chat": Compound( - {}, - ), - "narration": Compound( - { - "priority": String( - "chat", - ), - }, - ), - }, - ), - "name": String( - "minecraft:tellraw_command", - ), - }, - ), - ], - ), - "type": String( - "minecraft:chat_type", - ), - }, - ), - }, - ), - }, - ), - dimension_type: minecraft:overworld, - dimension: minecraft:overworld, - seed: 3162381063931772330, - max_players: 8, - chunk_radius: 12, - simulation_distance: 8, - reduced_debug_info: false, - show_death_screen: true, - is_debug: false, - is_flat: false, - last_death_location: None, -} \ No newline at end of file From e9e60eca80d159fd3e340ae91f2cfeb03c838f45 Mon Sep 17 00:00:00 2001 From: mat Date: Fri, 27 May 2022 00:05:14 -0500 Subject: [PATCH 24/27] Update README.md --- azalea-protocol/README.md | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/azalea-protocol/README.md b/azalea-protocol/README.md index b4741a3b..d2ad356e 100644 --- a/azalea-protocol/README.md +++ b/azalea-protocol/README.md @@ -12,13 +12,16 @@ Unfortunately, using azalea-protocol requires Rust nightly because [specializati Adding new packets is usually pretty easy, but you'll want to have Minecraft's decompiled source code which you can obtain with tools such as [DecompilerMC](https://github.com/hube12/DecompilerMC). -1. Find the packet in Minecraft's source code. Minecraft's packets are in the `net/minecraft/network/protocol/` directory. The state for your packet is usually `game`. -2. Add a new file in the [`packets/`](./src/packets/game) directory with the snake_cased version of the name Minecraft uses. -3. Copy the code from a similar packet and change the struct name. -4. Add the fields from Minecraft's source code from either the read or write methods. -If it's a `varint`, use `#[var] pub : i32` (or u32 if it makes more sense). -If it's a `varlong`, use `#[var] pub : i64` (or u64). -If it's a byte, use i8 or u8. -Etc.. You can look at [wiki.vg](https://wiki.vg/Protocol) if you're not sure about how a packet is structured, but be aware that wiki.vg uses different names for most things. -5. Add the packet to the `mod.rs` file in the same directory. You will have to look at [wiki.vg](https://wiki.vg/Protocol) to determine the packet id here. -6. That's it! Format your code, submit a pull request, and wait for it to be reviewed. +1. First, you'll need the packet id. You can get this from azalea-protocol error messages, or from wiki.vg. +2. Run `python codegen/newpacket.py [packet id] [clientbound or serverbound] \[game/handshake/login/status\]`\ +3. Go to the directory where it told you the packet was generated. If there's no comments, you're done. Otherwise, keep going. +4. Find the packet in Minecraft's source code. Minecraft's packets are in the `net/minecraft/network/protocol/` directory. The state for your packet is usually `game`. +5. Add the fields from Minecraft's source code from either the read or write methods. You can look at [wiki.vg](https://wiki.vg/Protocol) if you're not sure about how a packet is structured, but be aware that wiki.vg uses different names for most things. +6. Format the code, submit a pull request, and wait for it to be reviewed. + +### Implementing packets + +You can manually implement reading and writing functionality for a packet by implementing McBufReadable and McBufWritable, but you can also have this automatically generated for a struct or enum by deriving McBuf. + +Look at other packets as an example. + From cb4b060f35ad45b8abab08d23f11eaa63f4cc459 Mon Sep 17 00:00:00 2001 From: mat Date: Fri, 27 May 2022 00:32:10 -0500 Subject: [PATCH 25/27] Fix version.py to work from any directory --- codegen/lib/code/version.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/codegen/lib/code/version.py b/codegen/lib/code/version.py index 77911f16..e131a598 100644 --- a/codegen/lib/code/version.py +++ b/codegen/lib/code/version.py @@ -1,6 +1,7 @@ import re +import os -README_DIR = '../README.md' +README_DIR = os.path.join(os.path.dirname(__file__), '../../../README.md') VERSION_REGEX = r'\*Currently supported Minecraft version: `(.*)`.\*' @@ -30,6 +31,7 @@ def set_version_id(version_id: str) -> None: with open(README_DIR, 'w') as f: f.write(readme_text) + def get_protocol_version() -> str: # azalea-protocol/src/packets/mod.rs # pub const PROTOCOL_VERSION: u32 = 758; @@ -38,7 +40,9 @@ def get_protocol_version() -> str: for line in mod_rs: if line.strip().startswith('pub const PROTOCOL_VERSION'): return line.strip().split(' ')[-1].strip(';') - raise Exception('Could not find protocol version in azalea-protocol/src/packets/mod.rs') + raise Exception( + 'Could not find protocol version in azalea-protocol/src/packets/mod.rs') + def set_protocol_version(protocol_version: str) -> None: with open('../azalea-protocol/src/packets/mod.rs', 'r') as f: @@ -48,7 +52,8 @@ def set_protocol_version(protocol_version: str) -> None: mod_rs[i] = f'pub const PROTOCOL_VERSION: u32 = {protocol_version};' break else: - raise Exception('Could not find protocol version in azalea-protocol/src/packets/mod.rs') + raise Exception( + 'Could not find protocol version in azalea-protocol/src/packets/mod.rs') with open('../azalea-protocol/src/packets/mod.rs', 'w') as f: - f.write('\n'.join(mod_rs)) \ No newline at end of file + f.write('\n'.join(mod_rs)) From 05af65d16c06b6c2fd71908df6a68c5a8c57ba18 Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 8 Jun 2022 18:32:28 -0500 Subject: [PATCH 26/27] no burger.json --- codegen/lib/download.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/codegen/lib/download.py b/codegen/lib/download.py index 5030f8f3..7d14a3a3 100644 --- a/codegen/lib/download.py +++ b/codegen/lib/download.py @@ -10,9 +10,6 @@ if not os.path.exists('downloads'): def get_burger(): if not os.path.exists('downloads/Burger'): - with open('burger.json', 'w') as f: - json.dump(requests.get( - 'https://api.github.com/repos/Burger/Burger/releases/latest').json(), f) print('\033[92mDownloading Burger...\033[m') os.system( 'cd downloads && git clone https://github.com/pokechu22/Burger && cd Burger && git pull') From fb1d419a3d4207a293a1ad6001253192f1b4d12f Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 8 Jun 2022 18:37:29 -0500 Subject: [PATCH 27/27] 1.19 --- README.md | 2 +- azalea-protocol/src/packets/mod.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2ce2f26e..e57b4728 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ A Rust crate for creating Minecraft bots.

-*Currently supported Minecraft version: `1.19-pre3`.* +*Currently supported Minecraft version: `1.19`.* I named this Azalea because it sounds like a cool word and this is a cool library. This project was heavily inspired by PrismarineJS. diff --git a/azalea-protocol/src/packets/mod.rs b/azalea-protocol/src/packets/mod.rs index a06dc940..1cc79b79 100755 --- a/azalea-protocol/src/packets/mod.rs +++ b/azalea-protocol/src/packets/mod.rs @@ -12,7 +12,7 @@ use crate::{ use num_derive::FromPrimitive; use num_traits::FromPrimitive; -pub const PROTOCOL_VERSION: u32 = 1073741911; +pub const PROTOCOL_VERSION: u32 = 759; #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, FromPrimitive)] pub enum ConnectionProtocol {