diff options
| author | mat <github@matdoes.dev> | 2022-06-16 20:48:01 -0500 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-06-16 20:48:01 -0500 |
| commit | 4f89f70091962c967a7022e6f293f11a446abc3c (patch) | |
| tree | 9b18ee8cfa160e59cff0ba319e91fdce83e7d3ff | |
| parent | 5d5441427f21733046a8f4e5671276408f32c27f (diff) | |
| download | azalea-drasl-4f89f70091962c967a7022e6f293f11a446abc3c.tar.xz | |
type -> kind
| -rw-r--r-- | azalea-block/src/blocks.rs | 6 | ||||
| -rw-r--r-- | azalea-block/src/lib.rs | 1 | ||||
| -rw-r--r-- | codegen/lib/code/blocks.py | 4 |
3 files changed, 8 insertions, 3 deletions
diff --git a/azalea-block/src/blocks.rs b/azalea-block/src/blocks.rs index 77fb8276..b8d204fd 100644 --- a/azalea-block/src/blocks.rs +++ b/azalea-block/src/blocks.rs @@ -272,7 +272,7 @@ make_block_states! { Upper, Lower, }, - "type" => PistonType { + "kind" => PistonType { Normal, Sticky, }, @@ -333,7 +333,7 @@ make_block_states! { OuterLeft, OuterRight, }, - "type" => ChestType { + "kind" => ChestType { Single, Left, Right, @@ -936,7 +936,7 @@ make_block_states! { _14, _15, }, - "type" => Type { + "kind" => Type { Top, Bottom, Double, diff --git a/azalea-block/src/lib.rs b/azalea-block/src/lib.rs index 459b486e..01c86b11 100644 --- a/azalea-block/src/lib.rs +++ b/azalea-block/src/lib.rs @@ -3,3 +3,4 @@ mod blocks; pub use behavior::BlockBehavior; pub use blocks::*; + diff --git a/codegen/lib/code/blocks.py b/codegen/lib/code/blocks.py index f6d6bb4b..4ab4917f 100644 --- a/codegen/lib/code/blocks.py +++ b/codegen/lib/code/blocks.py @@ -103,6 +103,10 @@ def generate_blocks(blocks_burger: dict, blocks_report: dict, ordered_blocks: li ending = property_name.split('_')[-1] if ending.isdigit(): property_name = property_name[:-(len(ending) + 1)] + + # `type` is a reserved keyword, so we use kind instead ¯\_(ツ)_/¯ + if property_name == 'type': + property_name = 'kind' property_struct_names_to_names[property_struct_name] = property_name properties.update(block_properties) |
