aboutsummaryrefslogtreecommitdiff
path: root/codegen/lib/code
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-12-14 19:12:20 -0930
committermat <git@matdoes.dev>2025-12-14 19:12:20 -0930
commitde48bfc94ea4e62a8d5702d456aa4e82ced3890c (patch)
tree3b9e28a0a0562077b85e12d90c3c7e060bfe92f8 /codegen/lib/code
parentaab9f56da20a36347fe31557377e07a47c114dc6 (diff)
downloadazalea-drasl-de48bfc94ea4e62a8d5702d456aa4e82ced3890c.tar.xz
create typos.toml and fix typos
Diffstat (limited to 'codegen/lib/code')
-rw-r--r--codegen/lib/code/blocks.py8
-rw-r--r--codegen/lib/code/shapes.py10
-rw-r--r--codegen/lib/code/tags.py4
3 files changed, 13 insertions, 9 deletions
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