diff options
| -rw-r--r-- | azalea-registry/src/tags/blocks.rs | 2 | ||||
| -rw-r--r-- | azalea-world/src/world.rs | 2 | ||||
| -rw-r--r-- | codegen/genblocks.py | 6 | ||||
| -rw-r--r-- | codegen/lib/code/blocks.py | 8 | ||||
| -rw-r--r-- | codegen/lib/code/shapes.py | 10 | ||||
| -rw-r--r-- | codegen/lib/code/tags.py | 4 | ||||
| -rw-r--r-- | codegen/migrate.py | 6 | ||||
| -rw-r--r-- | typos.toml | 5 |
8 files changed, 26 insertions, 17 deletions
diff --git a/azalea-registry/src/tags/blocks.rs b/azalea-registry/src/tags/blocks.rs index 2f0e9d1a..6ef95597 100644 --- a/azalea-registry/src/tags/blocks.rs +++ b/azalea-registry/src/tags/blocks.rs @@ -704,7 +704,7 @@ pub static CONCRETE_POWDER: LazyLock<RegistryTag<BlockKind>> = LazyLock::new(|| BlockKind::BlackConcretePowder, ]) }); -pub static CONVERTABLE_TO_MUD: LazyLock<RegistryTag<BlockKind>> = LazyLock::new(|| { +pub static CONVERTIBLE_TO_MUD: LazyLock<RegistryTag<BlockKind>> = LazyLock::new(|| { RegistryTag::new(vec![ BlockKind::Dirt, BlockKind::CoarseDirt, diff --git a/azalea-world/src/world.rs b/azalea-world/src/world.rs index 82594986..e4260aee 100644 --- a/azalea-world/src/world.rs +++ b/azalea-world/src/world.rs @@ -52,7 +52,7 @@ impl PartialInstance { /// An entity ID used by Minecraft. /// -/// These IDs are picked by the server. Some server softwares (like Bungeecord) +/// These IDs are picked by the server. Some server software (like Bungeecord) /// may pick entity IDs per-player, so you should avoid relying on them for /// identifying IDs (especially if you're using a shared world -- i.e. a swarm). /// diff --git a/codegen/genblocks.py b/codegen/genblocks.py index 78cc56e6..10b298c2 100644 --- a/codegen/genblocks.py +++ b/codegen/genblocks.py @@ -9,7 +9,7 @@ import lib.utils def generate(version_id): - pumpkin_block_datas = lib.extract.get_pumpkin_data(version_id, "blocks") + pumpkin_blocks_data = lib.extract.get_pumpkin_data(version_id, "blocks") burger_data = lib.extract.get_burger_data_for_version(version_id) block_states_report = lib.extract.get_block_states_report(version_id) @@ -17,9 +17,9 @@ def generate(version_id): ordered_blocks = lib.code.blocks.get_ordered_blocks(registries) lib.code.blocks.generate_blocks( - block_states_report, pumpkin_block_datas, ordered_blocks, burger_data + block_states_report, pumpkin_blocks_data, ordered_blocks, burger_data ) - lib.code.shapes.generate_block_shapes(pumpkin_block_datas, block_states_report) + lib.code.shapes.generate_block_shapes(pumpkin_blocks_data, block_states_report) lib.code.utils.fmt() diff --git a/codegen/lib/code/blocks.py b/codegen/lib/code/blocks.py index 84d9fffb..091faaea 100644 --- a/codegen/lib/code/blocks.py +++ b/codegen/lib/code/blocks.py @@ -11,7 +11,7 @@ BLOCKS_RS_DIR = get_dir_location("../azalea-block/src/generated.rs") def generate_blocks( blocks_report: dict, - pumpkin_block_datas: dict, + pumpkin_blocks_data: dict, ordered_blocks: list[str], burger_data: dict, ): @@ -21,10 +21,10 @@ def generate_blocks( new_make_block_states_macro_code = [] new_make_block_states_macro_code.append("make_block_states! {") - burger_block_datas = burger_data[0]["blocks"]["block"] + burger_blocks_data = burger_data[0]["blocks"]["block"] pumpkin_block_map = {} - for block_data in pumpkin_block_datas["blocks"]: + for block_data in pumpkin_blocks_data["blocks"]: block_id = block_data["name"] pumpkin_block_map[block_id] = block_data @@ -89,7 +89,7 @@ def generate_blocks( new_make_block_states_macro_code.append(" Blocks => {") for block_id in ordered_blocks: block_data_report = blocks_report["minecraft:" + block_id] - block_data_burger = burger_block_datas.get(block_id, {}) + block_data_burger = burger_blocks_data.get(block_id, {}) block_data_pumpkin = pumpkin_block_map[block_id] default_property_variants: dict[str, str] = {} diff --git a/codegen/lib/code/shapes.py b/codegen/lib/code/shapes.py index f3a5d513..59b0cb98 100644 --- a/codegen/lib/code/shapes.py +++ b/codegen/lib/code/shapes.py @@ -3,8 +3,8 @@ from lib.utils import get_dir_location COLLISION_BLOCKS_RS_DIR = get_dir_location("../azalea-physics/src/collision/blocks.rs") -def generate_block_shapes(pumpkin_block_datas: dict, block_states_report): - blocks, shapes = simplify_shapes(pumpkin_block_datas) +def generate_block_shapes(pumpkin_blocks_data: dict, block_states_report): + blocks, shapes = simplify_shapes(pumpkin_blocks_data) code = generate_block_shapes_code(blocks, shapes, block_states_report) with open(COLLISION_BLOCKS_RS_DIR, "w") as f: @@ -79,9 +79,9 @@ def generate_block_shapes_code(blocks: dict, shapes: dict, block_states_report): collision_shapes_map = [] outline_shapes_map = [] - for block_id, shape_datas in blocks.items(): - collision_shapes = shape_datas["collision"] - outline_shapes = shape_datas["outline"] + for block_id, shapes_data in blocks.items(): + collision_shapes = shapes_data["collision"] + outline_shapes = shapes_data["outline"] if isinstance(collision_shapes, int): collision_shapes = [collision_shapes] diff --git a/codegen/lib/code/tags.py b/codegen/lib/code/tags.py index ff5a4061..651b6892 100644 --- a/codegen/lib/code/tags.py +++ b/codegen/lib/code/tags.py @@ -34,6 +34,10 @@ use crate::{{builtin::{struct_name}, tags::RegistryTag}}; tag_name = tag_name.replace("/", "_") static_set_name = to_snake_case(tag_name).upper() + + # fix mojang typo :) + static_set_name = static_set_name.replace("CONVERTABLE", "CONVERTIBLE") + generated += f"pub static {static_set_name}: LazyLock<RegistryTag<{struct_name}>> = LazyLock::new(|| RegistryTag::new(vec![" # this is important because we binary search registries in some cases diff --git a/codegen/migrate.py b/codegen/migrate.py index 643ea92c..bf7dde5a 100644 --- a/codegen/migrate.py +++ b/codegen/migrate.py @@ -40,7 +40,7 @@ lib.code.version.set_version_name(new_version_id) print("Updated protocol!") print("Generating blocks and shapes...") -new_pumpkin_block_datas = lib.extract.get_pumpkin_data(new_version_id, "blocks") +new_pumpkin_blocks_data = lib.extract.get_pumpkin_data(new_version_id, "blocks") new_block_states_report = lib.extract.get_block_states_report(new_version_id) new_registries = lib.extract.get_builtin_registries_report(new_version_id) @@ -48,11 +48,11 @@ new_ordered_blocks = lib.code.blocks.get_ordered_blocks(new_registries) lib.code.blocks.generate_blocks( new_block_states_report, - new_pumpkin_block_datas, + new_pumpkin_blocks_data, new_ordered_blocks, new_burger_data, ) -lib.code.shapes.generate_block_shapes(new_pumpkin_block_datas, new_block_states_report) +lib.code.shapes.generate_block_shapes(new_pumpkin_blocks_data, new_block_states_report) print("Getting en_us.json...") language = lib.extract.get_en_us_lang(new_version_id) diff --git a/typos.toml b/typos.toml new file mode 100644 index 00000000..6f576134 --- /dev/null +++ b/typos.toml @@ -0,0 +1,5 @@ +[files] +extend-exclude = ['azalea-language/src/en_us.json'] + +[default] +extend-ignore-re = ['Hel', 'inout', 'Shs', 'shs', '"CONVERTABLE"'] |
