From 4f89f70091962c967a7022e6f293f11a446abc3c Mon Sep 17 00:00:00 2001 From: mat Date: Thu, 16 Jun 2022 20:48:01 -0500 Subject: [PATCH] type -> kind --- azalea-block/src/blocks.rs | 6 +++--- azalea-block/src/lib.rs | 1 + 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)