1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 14:26:04 +00:00

type -> kind

This commit is contained in:
mat 2022-06-16 20:48:01 -05:00
parent 5d5441427f
commit 4f89f70091
3 changed files with 8 additions and 3 deletions

View file

@ -272,7 +272,7 @@ make_block_states! {
Upper, Upper,
Lower, Lower,
}, },
"type" => PistonType { "kind" => PistonType {
Normal, Normal,
Sticky, Sticky,
}, },
@ -333,7 +333,7 @@ make_block_states! {
OuterLeft, OuterLeft,
OuterRight, OuterRight,
}, },
"type" => ChestType { "kind" => ChestType {
Single, Single,
Left, Left,
Right, Right,
@ -936,7 +936,7 @@ make_block_states! {
_14, _14,
_15, _15,
}, },
"type" => Type { "kind" => Type {
Top, Top,
Bottom, Bottom,
Double, Double,

View file

@ -3,3 +3,4 @@ mod blocks;
pub use behavior::BlockBehavior; pub use behavior::BlockBehavior;
pub use blocks::*; pub use blocks::*;

View file

@ -103,6 +103,10 @@ def generate_blocks(blocks_burger: dict, blocks_report: dict, ordered_blocks: li
ending = property_name.split('_')[-1] ending = property_name.split('_')[-1]
if ending.isdigit(): if ending.isdigit():
property_name = property_name[:-(len(ending) + 1)] 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 property_struct_names_to_names[property_struct_name] = property_name
properties.update(block_properties) properties.update(block_properties)