aboutsummaryrefslogtreecommitdiff
path: root/codegen/lib
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-04-17 22:17:18 +0200
committermat <git@matdoes.dev>2025-04-17 11:09:14 -0930
commit2aa046c4b50a0de850eb567cd8bced03e8f99bd6 (patch)
tree2fda147226a725b588ef0e7ff36b22cad6509bd4 /codegen/lib
parent6a83a6fa387170ae71fbe06791cf3afa20aac1df (diff)
downloadazalea-drasl-2aa046c4b50a0de850eb567cd8bced03e8f99bd6.tar.xz
make BlockState::id private
Diffstat (limited to 'codegen/lib')
-rw-r--r--codegen/lib/code/shapes.py8
-rw-r--r--codegen/lib/utils.py2
2 files changed, 5 insertions, 5 deletions
diff --git a/codegen/lib/code/shapes.py b/codegen/lib/code/shapes.py
index 5d5f826d..0896bd82 100644
--- a/codegen/lib/code/shapes.py
+++ b/codegen/lib/code/shapes.py
@@ -151,18 +151,18 @@ pub trait BlockWithShape {{
impl BlockWithShape for BlockState {{
fn collision_shape(&self) -> &'static VoxelShape {{
- COLLISION_SHAPES_MAP.get(self.id as usize).unwrap_or(&&SHAPE1)
+ COLLISION_SHAPES_MAP.get(self.id() as usize).unwrap_or(&&SHAPE1)
}}
fn outline_shape(&self) -> &'static VoxelShape {{
- OUTLINE_SHAPES_MAP.get(self.id as usize).unwrap_or(&&SHAPE1)
+ OUTLINE_SHAPES_MAP.get(self.id() as usize).unwrap_or(&&SHAPE1)
}}
fn is_collision_shape_empty(&self) -> bool {{
- matches!(self.id, {empty_shape_match_code})
+ matches!(self.id(), {empty_shape_match_code})
}}
fn is_collision_shape_full(&self) -> bool {{
- matches!(self.id, {block_shape_match_code})
+ matches!(self.id(), {block_shape_match_code})
}}
}}
diff --git a/codegen/lib/utils.py b/codegen/lib/utils.py
index 162dd0fa..fd1e553b 100644
--- a/codegen/lib/utils.py
+++ b/codegen/lib/utils.py
@@ -10,7 +10,7 @@ def to_snake_case(name: str):
def to_camel_case(name: str):
- s = re.sub('[_ ](\w)', lambda m: m.group(1).upper(),
+ s = re.sub(r'[_ ](\w)', lambda m: m.group(1).upper(),
name.replace('.', '_').replace('/', '_'))
s = upper_first_letter(s)
# if the first character is a number, we need to add an underscore