diff --git a/azalea-block/src/blocks.rs b/azalea-block/src/blocks.rs index 71d04f99..faaafbb1 100644 --- a/azalea-block/src/blocks.rs +++ b/azalea-block/src/blocks.rs @@ -59,7 +59,7 @@ make_block_states! { True, False, }, - Distance { + AcaciaLeavesDistance { _1, _2, _3, @@ -77,11 +77,11 @@ make_block_states! { Y, Z, }, - Stage { + AcaciaSaplingStage { _0, _1, }, - Rotation { + AcaciaSignRotation { _0, _1, _2, @@ -135,8 +135,7 @@ make_block_states! { Low, Tall, }, - Age { - _0, + AzaleaLeavesDistance { _1, _2, _3, @@ -145,12 +144,20 @@ make_block_states! { _6, _7, }, + BambooAge { + _0, + _1, + }, Leaves { None, Small, Large, }, - HoneyLevel { + BambooStage { + _0, + _1, + }, + BeeNestHoneyLevel { _0, _1, _2, @@ -158,6 +165,20 @@ make_block_states! { _4, _5, }, + BeehiveHoneyLevel { + _0, + _1, + _2, + _3, + _4, + _5, + }, + BeetrootsAge { + _0, + _1, + _2, + _3, + }, Attachment { Floor, Ceiling, @@ -170,6 +191,55 @@ make_block_states! { Partial, Full, }, + BirchLeavesDistance { + _1, + _2, + _3, + _4, + _5, + _6, + _7, + }, + BirchSaplingStage { + _0, + _1, + }, + BirchSignRotation { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, + BlackBannerRotation { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, Occupied { True, False, @@ -178,7 +248,7 @@ make_block_states! { Head, Foot, }, - Candles { + BlackCandleCandles { _1, _2, _3, @@ -188,10 +258,58 @@ make_block_states! { True, False, }, + BlueBannerRotation { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, + BlueCandleCandles { + _1, + _2, + _3, + _4, + }, HasBottle { True, False, }, + BrownBannerRotation { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, + BrownCandleCandles { + _1, + _2, + _3, + _4, + }, Down { True, False, @@ -200,7 +318,25 @@ make_block_states! { True, False, }, - Bites { + CactusAge { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, + CakeBites { _0, _1, _2, @@ -213,26 +349,152 @@ make_block_states! { True, False, }, + CandleCandles { + _1, + _2, + _3, + _4, + }, + CarrotsAge { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + }, Conditional { True, False, }, + ChorusFlowerAge { + _0, + _1, + _2, + _3, + _4, + _5, + }, + CocoaAge { + _0, + _1, + _2, + }, Mode { Save, Load, Corner, Data, }, - Level { + ComposterLevel { + _0, _1, _2, _3, + _4, + _5, + _6, + _7, + _8, + }, + CreeperHeadRotation { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, + CrimsonSignRotation { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, + CyanBannerRotation { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, + CyanCandleCandles { + _1, + _2, + _3, + _4, + }, + DarkOakLeavesDistance { + _1, + _2, + _3, + _4, + _5, + _6, + _7, + }, + DarkOakSaplingStage { + _0, + _1, + }, + DarkOakSignRotation { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, }, Inverted { True, False, }, - Power { + DaylightDetectorPower { _0, _1, _2, @@ -254,11 +516,29 @@ make_block_states! { True, False, }, + DragonHeadRotation { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, HasEye { True, False, }, - Moisture { + FarmlandMoisture { _0, _1, _2, @@ -268,10 +548,109 @@ make_block_states! { _6, _7, }, + FireAge { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, + FloweringAzaleaLeavesDistance { + _1, + _2, + _3, + _4, + _5, + _6, + _7, + }, + FrostedIceAge { + _0, + _1, + _2, + _3, + }, Snowy { True, False, }, + GrayBannerRotation { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, + GrayCandleCandles { + _1, + _2, + _3, + _4, + }, + GreenBannerRotation { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, + GreenCandleCandles { + _1, + _2, + _3, + _4, + }, + HeavyWeightedPressurePlatePower { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, Enabled { True, False, @@ -294,14 +673,277 @@ make_block_states! { True, False, }, + JungleLeavesDistance { + _1, + _2, + _3, + _4, + _5, + _6, + _7, + }, + JungleSaplingStage { + _0, + _1, + }, + JungleSignRotation { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, + KelpAge { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + _16, + _17, + _18, + _19, + _20, + _21, + _22, + _23, + _24, + _25, + }, Hanging { True, False, }, + LavaLevel { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, HasBook { True, False, }, + LightLevel { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, + LightBlueBannerRotation { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, + LightBlueCandleCandles { + _1, + _2, + _3, + _4, + }, + LightGrayBannerRotation { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, + LightGrayCandleCandles { + _1, + _2, + _3, + _4, + }, + LightWeightedPressurePlatePower { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, + LimeBannerRotation { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, + LimeCandleCandles { + _1, + _2, + _3, + _4, + }, + MagentaBannerRotation { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, + MagentaCandleCandles { + _1, + _2, + _3, + _4, + }, + MangroveLeavesDistance { + _1, + _2, + _3, + _4, + _5, + _6, + _7, + }, + MangrovePropaguleAge { + _0, + _1, + _2, + _3, + _4, + }, + MangrovePropaguleStage { + _0, + _1, + }, + MangroveSignRotation { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, + MelonStemAge { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + }, + NetherWartAge { + _0, + _1, + _2, + _3, + }, Instrument { Harp, Basedrum, @@ -320,7 +962,7 @@ make_block_states! { Banjo, Pling, }, - Note { + NoteBlockNote { _0, _1, _2, @@ -347,6 +989,85 @@ make_block_states! { _23, _24, }, + OakLeavesDistance { + _1, + _2, + _3, + _4, + _5, + _6, + _7, + }, + OakSaplingStage { + _0, + _1, + }, + OakSignRotation { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, + OrangeBannerRotation { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, + OrangeCandleCandles { + _1, + _2, + _3, + _4, + }, + PinkBannerRotation { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, + PinkCandleCandles { + _1, + _2, + _3, + _4, + }, Extended { True, False, @@ -355,6 +1076,24 @@ make_block_states! { True, False, }, + PlayerHeadRotation { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, Thickness { TipMerge, Tip, @@ -366,7 +1105,98 @@ make_block_states! { Up, Down, }, - Delay { + PotatoesAge { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + }, + PowderSnowCauldronLevel { + _1, + _2, + _3, + }, + PumpkinStemAge { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + }, + PurpleBannerRotation { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, + PurpleCandleCandles { + _1, + _2, + _3, + _4, + }, + RedBannerRotation { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, + RedCandleCandles { + _1, + _2, + _3, + _4, + }, + RedstoneWirePower { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, + RepeaterDelay { _1, _2, _3, @@ -376,7 +1206,7 @@ make_block_states! { True, False, }, - Charge { + RespawnAnchorCharge { _0, _1, _2, @@ -387,10 +1217,38 @@ make_block_states! { True, False, }, + ScaffoldingDistance { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + }, Pulse { True, False, }, + SculkSensorPower { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, Phase { Inactive, Active, @@ -404,13 +1262,31 @@ make_block_states! { True, False, }, - Pickles { + SeaPicklePickles { _1, _2, _3, _4, }, - Layers { + SkeletonSkullRotation { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, + SnowLayers { _1, _2, _3, @@ -420,7 +1296,62 @@ make_block_states! { _7, _8, }, - OutputPower { + SpruceLeavesDistance { + _1, + _2, + _3, + _4, + _5, + _6, + _7, + }, + SpruceSaplingStage { + _0, + _1, + }, + SpruceSignRotation { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, + SugarCaneAge { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, + SweetBerryBushAge { + _0, + _1, + _2, + _3, + }, + TargetOutputPower { _0, _1, _2, @@ -450,17 +1381,208 @@ make_block_states! { True, False, }, - Eggs { + TurtleEggEggs { _1, _2, _3, _4, }, - Hatch { + TurtleEggHatch { _0, _1, _2, }, + TwistingVinesAge { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + _16, + _17, + _18, + _19, + _20, + _21, + _22, + _23, + _24, + _25, + }, + WarpedSignRotation { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, + WaterLevel { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, + WaterCauldronLevel { + _1, + _2, + _3, + }, + WeepingVinesAge { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + _16, + _17, + _18, + _19, + _20, + _21, + _22, + _23, + _24, + _25, + }, + WheatAge { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + }, + WhiteBannerRotation { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, + WhiteCandleCandles { + _1, + _2, + _3, + _4, + }, + WitherSkeletonSkullRotation { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, + YellowBannerRotation { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, + YellowCandleCandles { + _1, + _2, + _3, + _4, + }, + ZombieHeadRotation { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, }, Blocks => { acacia_button => BlockBehavior::default(), { @@ -489,7 +1611,7 @@ make_block_states! { InWall=False, }, acacia_leaves => BlockBehavior::default(), { - Distance=_7, + AcaciaLeavesDistance=_7, Persistent=False, Waterlogged=False, }, @@ -502,10 +1624,10 @@ make_block_states! { Powered=False, }, acacia_sapling => BlockBehavior::default(), { - Stage=_0, + AcaciaSaplingStage=_0, }, acacia_sign => BlockBehavior::default(), { - Rotation=_0, + AcaciaSignRotation=_0, Waterlogged=False, }, acacia_slab => BlockBehavior::default(), { @@ -581,16 +1703,16 @@ make_block_states! { azalea => BlockBehavior::default(), { }, azalea_leaves => BlockBehavior::default(), { - Distance=_7, + AzaleaLeavesDistance=_7, Persistent=False, Waterlogged=False, }, azure_bluet => BlockBehavior::default(), { }, bamboo => BlockBehavior::default(), { - Age=_0, + BambooAge=_0, Leaves=None, - Stage=_0, + BambooStage=_0, }, bamboo_sapling => BlockBehavior::default(), { }, @@ -608,15 +1730,15 @@ make_block_states! { bedrock => BlockBehavior::default(), { }, bee_nest => BlockBehavior::default(), { - HoneyLevel=_0, + BeeNestHoneyLevel=_0, Facing=North, }, beehive => BlockBehavior::default(), { - HoneyLevel=_0, + BeehiveHoneyLevel=_0, Facing=North, }, beetroots => BlockBehavior::default(), { - Age=_0, + BeetrootsAge=_0, }, bell => BlockBehavior::default(), { Facing=North, @@ -658,7 +1780,7 @@ make_block_states! { InWall=False, }, birch_leaves => BlockBehavior::default(), { - Distance=_7, + BirchLeavesDistance=_7, Persistent=False, Waterlogged=False, }, @@ -671,10 +1793,10 @@ make_block_states! { Powered=False, }, birch_sapling => BlockBehavior::default(), { - Stage=_0, + BirchSaplingStage=_0, }, birch_sign => BlockBehavior::default(), { - Rotation=_0, + BirchSignRotation=_0, Waterlogged=False, }, birch_slab => BlockBehavior::default(), { @@ -702,7 +1824,7 @@ make_block_states! { Axis=Y, }, black_banner => BlockBehavior::default(), { - Rotation=_0, + BlackBannerRotation=_0, }, black_bed => BlockBehavior::default(), { Facing=North, @@ -710,7 +1832,7 @@ make_block_states! { Occupied=False, }, black_candle => BlockBehavior::default(), { - Candles=_1, + BlackCandleCandles=_1, Lit=False, Waterlogged=False, }, @@ -770,7 +1892,7 @@ make_block_states! { Lit=False, }, blue_banner => BlockBehavior::default(), { - Rotation=_0, + BlueBannerRotation=_0, }, blue_bed => BlockBehavior::default(), { Facing=North, @@ -778,7 +1900,7 @@ make_block_states! { Occupied=False, }, blue_candle => BlockBehavior::default(), { - Candles=_1, + BlueCandleCandles=_1, Lit=False, Waterlogged=False, }, @@ -860,7 +1982,7 @@ make_block_states! { bricks => BlockBehavior::default(), { }, brown_banner => BlockBehavior::default(), { - Rotation=_0, + BrownBannerRotation=_0, }, brown_bed => BlockBehavior::default(), { Facing=North, @@ -868,7 +1990,7 @@ make_block_states! { Occupied=False, }, brown_candle => BlockBehavior::default(), { - Candles=_1, + BrownCandleCandles=_1, Lit=False, Waterlogged=False, }, @@ -931,10 +2053,10 @@ make_block_states! { budding_amethyst => BlockBehavior::default(), { }, cactus => BlockBehavior::default(), { - Age=_0, + CactusAge=_0, }, cake => BlockBehavior::default(), { - Bites=_0, + CakeBites=_0, }, calcite => BlockBehavior::default(), { }, @@ -945,7 +2067,7 @@ make_block_states! { Facing=North, }, candle => BlockBehavior::default(), { - Candles=_1, + CandleCandles=_1, Lit=False, Waterlogged=False, }, @@ -953,7 +2075,7 @@ make_block_states! { Lit=False, }, carrots => BlockBehavior::default(), { - Age=_0, + CarrotsAge=_0, }, cartography_table => BlockBehavior::default(), { }, @@ -999,7 +2121,7 @@ make_block_states! { chiseled_stone_bricks => BlockBehavior::default(), { }, chorus_flower => BlockBehavior::default(), { - Age=_0, + ChorusFlowerAge=_0, }, chorus_plant => BlockBehavior::default(), { North=False, @@ -1061,7 +2183,7 @@ make_block_states! { }, cocoa => BlockBehavior::default(), { Facing=North, - Age=_0, + CocoaAge=_0, }, command_block => BlockBehavior::default(), { Facing=North, @@ -1073,7 +2195,7 @@ make_block_states! { Powered=False, }, composter => BlockBehavior::default(), { - Level=_0, + ComposterLevel=_0, }, conduit => BlockBehavior::default(), { Waterlogged=True, @@ -1097,7 +2219,7 @@ make_block_states! { crafting_table => BlockBehavior::default(), { }, creeper_head => BlockBehavior::default(), { - Rotation=_0, + CreeperHeadRotation=_0, }, creeper_wall_head => BlockBehavior::default(), { Facing=North, @@ -1142,7 +2264,7 @@ make_block_states! { crimson_roots => BlockBehavior::default(), { }, crimson_sign => BlockBehavior::default(), { - Rotation=_0, + CrimsonSignRotation=_0, Waterlogged=False, }, crimson_slab => BlockBehavior::default(), { @@ -1196,7 +2318,7 @@ make_block_states! { Waterlogged=False, }, cyan_banner => BlockBehavior::default(), { - Rotation=_0, + CyanBannerRotation=_0, }, cyan_bed => BlockBehavior::default(), { Facing=North, @@ -1204,7 +2326,7 @@ make_block_states! { Occupied=False, }, cyan_candle => BlockBehavior::default(), { - Candles=_1, + CyanCandleCandles=_1, Lit=False, Waterlogged=False, }, @@ -1270,7 +2392,7 @@ make_block_states! { InWall=False, }, dark_oak_leaves => BlockBehavior::default(), { - Distance=_7, + DarkOakLeavesDistance=_7, Persistent=False, Waterlogged=False, }, @@ -1283,10 +2405,10 @@ make_block_states! { Powered=False, }, dark_oak_sapling => BlockBehavior::default(), { - Stage=_0, + DarkOakSaplingStage=_0, }, dark_oak_sign => BlockBehavior::default(), { - Rotation=_0, + DarkOakSignRotation=_0, Waterlogged=False, }, dark_oak_slab => BlockBehavior::default(), { @@ -1326,7 +2448,7 @@ make_block_states! { Waterlogged=False, }, daylight_detector => BlockBehavior::default(), { - Power=_0, + DaylightDetectorPower=_0, Inverted=False, }, dead_brain_coral => BlockBehavior::default(), { @@ -1491,7 +2613,7 @@ make_block_states! { dragon_egg => BlockBehavior::default(), { }, dragon_head => BlockBehavior::default(), { - Rotation=_0, + DragonHeadRotation=_0, }, dragon_wall_head => BlockBehavior::default(), { Facing=North, @@ -1562,12 +2684,12 @@ make_block_states! { Waterlogged=False, }, farmland => BlockBehavior::default(), { - Moisture=_0, + FarmlandMoisture=_0, }, fern => BlockBehavior::default(), { }, fire => BlockBehavior::default(), { - Age=_0, + FireAge=_0, North=False, East=False, South=False, @@ -1593,14 +2715,14 @@ make_block_states! { flowering_azalea => BlockBehavior::default(), { }, flowering_azalea_leaves => BlockBehavior::default(), { - Distance=_7, + FloweringAzaleaLeavesDistance=_7, Persistent=False, Waterlogged=False, }, frogspawn => BlockBehavior::default(), { }, frosted_ice => BlockBehavior::default(), { - Age=_0, + FrostedIceAge=_0, }, furnace => BlockBehavior::default(), { Facing=North, @@ -1653,7 +2775,7 @@ make_block_states! { gravel => BlockBehavior::default(), { }, gray_banner => BlockBehavior::default(), { - Rotation=_0, + GrayBannerRotation=_0, }, gray_bed => BlockBehavior::default(), { Facing=North, @@ -1661,7 +2783,7 @@ make_block_states! { Occupied=False, }, gray_candle => BlockBehavior::default(), { - Candles=_1, + GrayCandleCandles=_1, Lit=False, Waterlogged=False, }, @@ -1697,7 +2819,7 @@ make_block_states! { gray_wool => BlockBehavior::default(), { }, green_banner => BlockBehavior::default(), { - Rotation=_0, + GreenBannerRotation=_0, }, green_bed => BlockBehavior::default(), { Facing=North, @@ -1705,7 +2827,7 @@ make_block_states! { Occupied=False, }, green_candle => BlockBehavior::default(), { - Candles=_1, + GreenCandleCandles=_1, Lit=False, Waterlogged=False, }, @@ -1751,7 +2873,7 @@ make_block_states! { Axis=Y, }, heavy_weighted_pressure_plate => BlockBehavior::default(), { - Power=_0, + HeavyWeightedPressurePlatePower=_0, }, honey_block => BlockBehavior::default(), { }, @@ -1849,7 +2971,7 @@ make_block_states! { InWall=False, }, jungle_leaves => BlockBehavior::default(), { - Distance=_7, + JungleLeavesDistance=_7, Persistent=False, Waterlogged=False, }, @@ -1862,10 +2984,10 @@ make_block_states! { Powered=False, }, jungle_sapling => BlockBehavior::default(), { - Stage=_0, + JungleSaplingStage=_0, }, jungle_sign => BlockBehavior::default(), { - Rotation=_0, + JungleSignRotation=_0, Waterlogged=False, }, jungle_slab => BlockBehavior::default(), { @@ -1893,7 +3015,7 @@ make_block_states! { Axis=Y, }, kelp => BlockBehavior::default(), { - Age=_0, + KelpAge=_0, }, kelp_plant => BlockBehavior::default(), { }, @@ -1917,7 +3039,7 @@ make_block_states! { Half=Lower, }, lava => BlockBehavior::default(), { - Level=_0, + LavaLevel=_0, }, lava_cauldron => BlockBehavior::default(), { }, @@ -1932,11 +3054,11 @@ make_block_states! { Powered=False, }, light => BlockBehavior::default(), { - Level=_15, + LightLevel=_15, Waterlogged=False, }, light_blue_banner => BlockBehavior::default(), { - Rotation=_0, + LightBlueBannerRotation=_0, }, light_blue_bed => BlockBehavior::default(), { Facing=North, @@ -1944,7 +3066,7 @@ make_block_states! { Occupied=False, }, light_blue_candle => BlockBehavior::default(), { - Candles=_1, + LightBlueCandleCandles=_1, Lit=False, Waterlogged=False, }, @@ -1980,7 +3102,7 @@ make_block_states! { light_blue_wool => BlockBehavior::default(), { }, light_gray_banner => BlockBehavior::default(), { - Rotation=_0, + LightGrayBannerRotation=_0, }, light_gray_bed => BlockBehavior::default(), { Facing=North, @@ -1988,7 +3110,7 @@ make_block_states! { Occupied=False, }, light_gray_candle => BlockBehavior::default(), { - Candles=_1, + LightGrayCandleCandles=_1, Lit=False, Waterlogged=False, }, @@ -2024,7 +3146,7 @@ make_block_states! { light_gray_wool => BlockBehavior::default(), { }, light_weighted_pressure_plate => BlockBehavior::default(), { - Power=_0, + LightWeightedPressurePlatePower=_0, }, lightning_rod => BlockBehavior::default(), { Facing=Up, @@ -2039,7 +3161,7 @@ make_block_states! { lily_pad => BlockBehavior::default(), { }, lime_banner => BlockBehavior::default(), { - Rotation=_0, + LimeBannerRotation=_0, }, lime_bed => BlockBehavior::default(), { Facing=North, @@ -2047,7 +3169,7 @@ make_block_states! { Occupied=False, }, lime_candle => BlockBehavior::default(), { - Candles=_1, + LimeCandleCandles=_1, Lit=False, Waterlogged=False, }, @@ -2088,7 +3210,7 @@ make_block_states! { Facing=North, }, magenta_banner => BlockBehavior::default(), { - Rotation=_0, + MagentaBannerRotation=_0, }, magenta_bed => BlockBehavior::default(), { Facing=North, @@ -2096,7 +3218,7 @@ make_block_states! { Occupied=False, }, magenta_candle => BlockBehavior::default(), { - Candles=_1, + MagentaCandleCandles=_1, Lit=False, Waterlogged=False, }, @@ -2159,7 +3281,7 @@ make_block_states! { InWall=False, }, mangrove_leaves => BlockBehavior::default(), { - Distance=_7, + MangroveLeavesDistance=_7, Persistent=False, Waterlogged=False, }, @@ -2172,8 +3294,8 @@ make_block_states! { Powered=False, }, mangrove_propagule => BlockBehavior::default(), { - Stage=_0, - Age=_0, + MangrovePropaguleStage=_0, + MangrovePropaguleAge=_0, Waterlogged=False, Hanging=False, }, @@ -2181,7 +3303,7 @@ make_block_states! { Waterlogged=False, }, mangrove_sign => BlockBehavior::default(), { - Rotation=_0, + MangroveSignRotation=_0, Waterlogged=False, }, mangrove_slab => BlockBehavior::default(), { @@ -2215,7 +3337,7 @@ make_block_states! { melon => BlockBehavior::default(), { }, melon_stem => BlockBehavior::default(), { - Age=_0, + MelonStemAge=_0, }, moss_block => BlockBehavior::default(), { }, @@ -2338,7 +3460,7 @@ make_block_states! { nether_sprouts => BlockBehavior::default(), { }, nether_wart => BlockBehavior::default(), { - Age=_0, + NetherWartAge=_0, }, nether_wart_block => BlockBehavior::default(), { }, @@ -2349,7 +3471,7 @@ make_block_states! { note_block => BlockBehavior::default(), { Instrument=Harp, Powered=False, - Note=_0, + NoteBlockNote=_0, }, oak_button => BlockBehavior::default(), { Facing=North, @@ -2377,7 +3499,7 @@ make_block_states! { InWall=False, }, oak_leaves => BlockBehavior::default(), { - Distance=_7, + OakLeavesDistance=_7, Persistent=False, Waterlogged=False, }, @@ -2390,10 +3512,10 @@ make_block_states! { Powered=False, }, oak_sapling => BlockBehavior::default(), { - Stage=_0, + OakSaplingStage=_0, }, oak_sign => BlockBehavior::default(), { - Rotation=_0, + OakSignRotation=_0, Waterlogged=False, }, oak_slab => BlockBehavior::default(), { @@ -2430,7 +3552,7 @@ make_block_states! { Axis=Y, }, orange_banner => BlockBehavior::default(), { - Rotation=_0, + OrangeBannerRotation=_0, }, orange_bed => BlockBehavior::default(), { Facing=North, @@ -2438,7 +3560,7 @@ make_block_states! { Occupied=False, }, orange_candle => BlockBehavior::default(), { - Candles=_1, + OrangeCandleCandles=_1, Lit=False, Waterlogged=False, }, @@ -2506,7 +3628,7 @@ make_block_states! { Waterlogged=False, }, pink_banner => BlockBehavior::default(), { - Rotation=_0, + PinkBannerRotation=_0, }, pink_bed => BlockBehavior::default(), { Facing=North, @@ -2514,7 +3636,7 @@ make_block_states! { Occupied=False, }, pink_candle => BlockBehavior::default(), { - Candles=_1, + PinkCandleCandles=_1, Lit=False, Waterlogged=False, }, @@ -2561,7 +3683,7 @@ make_block_states! { Short=False, }, player_head => BlockBehavior::default(), { - Rotation=_0, + PlayerHeadRotation=_0, }, player_wall_head => BlockBehavior::default(), { Facing=North, @@ -2684,7 +3806,7 @@ make_block_states! { poppy => BlockBehavior::default(), { }, potatoes => BlockBehavior::default(), { - Age=_0, + PotatoesAge=_0, }, potted_acacia_sapling => BlockBehavior::default(), { }, @@ -2753,7 +3875,7 @@ make_block_states! { powder_snow => BlockBehavior::default(), { }, powder_snow_cauldron => BlockBehavior::default(), { - Level=_1, + PowderSnowCauldronLevel=_1, }, powered_rail => BlockBehavior::default(), { Shape=NorthSouth, @@ -2795,10 +3917,10 @@ make_block_states! { pumpkin => BlockBehavior::default(), { }, pumpkin_stem => BlockBehavior::default(), { - Age=_0, + PumpkinStemAge=_0, }, purple_banner => BlockBehavior::default(), { - Rotation=_0, + PurpleBannerRotation=_0, }, purple_bed => BlockBehavior::default(), { Facing=North, @@ -2806,7 +3928,7 @@ make_block_states! { Occupied=False, }, purple_candle => BlockBehavior::default(), { - Candles=_1, + PurpleCandleCandles=_1, Lit=False, Waterlogged=False, }, @@ -2884,7 +4006,7 @@ make_block_states! { raw_iron_block => BlockBehavior::default(), { }, red_banner => BlockBehavior::default(), { - Rotation=_0, + RedBannerRotation=_0, }, red_bed => BlockBehavior::default(), { Facing=North, @@ -2892,7 +4014,7 @@ make_block_states! { Occupied=False, }, red_candle => BlockBehavior::default(), { - Candles=_1, + RedCandleCandles=_1, Lit=False, Waterlogged=False, }, @@ -3001,13 +4123,13 @@ make_block_states! { East=None, South=None, West=None, - Power=_0, + RedstoneWirePower=_0, }, reinforced_deepslate => BlockBehavior::default(), { }, repeater => BlockBehavior::default(), { Facing=North, - Delay=_1, + RepeaterDelay=_1, Locked=False, Powered=False, }, @@ -3016,7 +4138,7 @@ make_block_states! { Conditional=False, }, respawn_anchor => BlockBehavior::default(), { - Charge=_0, + RespawnAnchorCharge=_0, }, rooted_dirt => BlockBehavior::default(), { }, @@ -3046,7 +4168,7 @@ make_block_states! { Waterlogged=False, }, scaffolding => BlockBehavior::default(), { - Distance=_7, + ScaffoldingDistance=_7, Waterlogged=False, Bottom=False, }, @@ -3057,7 +4179,7 @@ make_block_states! { }, sculk_sensor => BlockBehavior::default(), { Phase=Inactive, - Power=_0, + SculkSensorPower=_0, Waterlogged=False, }, sculk_shrieker => BlockBehavior::default(), { @@ -3070,7 +4192,7 @@ make_block_states! { sea_lantern => BlockBehavior::default(), { }, sea_pickle => BlockBehavior::default(), { - Pickles=_1, + SeaPicklePickles=_1, Waterlogged=True, }, seagrass => BlockBehavior::default(), { @@ -3081,7 +4203,7 @@ make_block_states! { Facing=Up, }, skeleton_skull => BlockBehavior::default(), { - Rotation=_0, + SkeletonSkullRotation=_0, }, skeleton_wall_skull => BlockBehavior::default(), { Facing=North, @@ -3148,7 +4270,7 @@ make_block_states! { Waterlogged=False, }, snow => BlockBehavior::default(), { - Layers=_1, + SnowLayers=_1, }, snow_block => BlockBehavior::default(), { }, @@ -3205,7 +4327,7 @@ make_block_states! { InWall=False, }, spruce_leaves => BlockBehavior::default(), { - Distance=_7, + SpruceLeavesDistance=_7, Persistent=False, Waterlogged=False, }, @@ -3218,10 +4340,10 @@ make_block_states! { Powered=False, }, spruce_sapling => BlockBehavior::default(), { - Stage=_0, + SpruceSaplingStage=_0, }, spruce_sign => BlockBehavior::default(), { - Rotation=_0, + SpruceSignRotation=_0, Waterlogged=False, }, spruce_slab => BlockBehavior::default(), { @@ -3355,13 +4477,13 @@ make_block_states! { structure_void => BlockBehavior::default(), { }, sugar_cane => BlockBehavior::default(), { - Age=_0, + SugarCaneAge=_0, }, sunflower => BlockBehavior::default(), { Half=Lower, }, sweet_berry_bush => BlockBehavior::default(), { - Age=_0, + SweetBerryBushAge=_0, }, tall_grass => BlockBehavior::default(), { Half=Lower, @@ -3370,7 +4492,7 @@ make_block_states! { Half=Lower, }, target => BlockBehavior::default(), { - OutputPower=_0, + TargetOutputPower=_0, }, terracotta => BlockBehavior::default(), { }, @@ -3415,11 +4537,11 @@ make_block_states! { tuff => BlockBehavior::default(), { }, turtle_egg => BlockBehavior::default(), { - Hatch=_0, - Eggs=_1, + TurtleEggHatch=_0, + TurtleEggEggs=_1, }, twisting_vines => BlockBehavior::default(), { - Age=_0, + TwistingVinesAge=_0, }, twisting_vines_plant => BlockBehavior::default(), { }, @@ -3478,7 +4600,7 @@ make_block_states! { warped_roots => BlockBehavior::default(), { }, warped_sign => BlockBehavior::default(), { - Rotation=_0, + WarpedSignRotation=_0, Waterlogged=False, }, warped_slab => BlockBehavior::default(), { @@ -3508,10 +4630,10 @@ make_block_states! { warped_wart_block => BlockBehavior::default(), { }, water => BlockBehavior::default(), { - Level=_0, + WaterLevel=_0, }, water_cauldron => BlockBehavior::default(), { - Level=_1, + WaterCauldronLevel=_1, }, waxed_copper_block => BlockBehavior::default(), { }, @@ -3584,17 +4706,17 @@ make_block_states! { Waterlogged=False, }, weeping_vines => BlockBehavior::default(), { - Age=_0, + WeepingVinesAge=_0, }, weeping_vines_plant => BlockBehavior::default(), { }, wet_sponge => BlockBehavior::default(), { }, wheat => BlockBehavior::default(), { - Age=_0, + WheatAge=_0, }, white_banner => BlockBehavior::default(), { - Rotation=_0, + WhiteBannerRotation=_0, }, white_bed => BlockBehavior::default(), { Facing=North, @@ -3602,7 +4724,7 @@ make_block_states! { Occupied=False, }, white_candle => BlockBehavior::default(), { - Candles=_1, + WhiteCandleCandles=_1, Lit=False, Waterlogged=False, }, @@ -3642,13 +4764,13 @@ make_block_states! { wither_rose => BlockBehavior::default(), { }, wither_skeleton_skull => BlockBehavior::default(), { - Rotation=_0, + WitherSkeletonSkullRotation=_0, }, wither_skeleton_wall_skull => BlockBehavior::default(), { Facing=North, }, yellow_banner => BlockBehavior::default(), { - Rotation=_0, + YellowBannerRotation=_0, }, yellow_bed => BlockBehavior::default(), { Facing=North, @@ -3656,7 +4778,7 @@ make_block_states! { Occupied=False, }, yellow_candle => BlockBehavior::default(), { - Candles=_1, + YellowCandleCandles=_1, Lit=False, Waterlogged=False, }, @@ -3692,7 +4814,7 @@ make_block_states! { yellow_wool => BlockBehavior::default(), { }, zombie_head => BlockBehavior::default(), { - Rotation=_0, + ZombieHeadRotation=_0, }, zombie_wall_head => BlockBehavior::default(), { Facing=North, diff --git a/codegen/lib/code/blocks.py b/codegen/lib/code/blocks.py index a5c9e2c6..d2fe6da2 100644 --- a/codegen/lib/code/blocks.py +++ b/codegen/lib/code/blocks.py @@ -1,7 +1,7 @@ +from lib.utils import upper_first_letter from lib.utils import get_dir_location from lib.utils import to_camel_case from ..mappings import Mappings -import json BLOCKS_RS_DIR = get_dir_location('../azalea-block/src/blocks.rs') @@ -25,7 +25,9 @@ def generate_blocks(blocks_burger: dict, blocks_report: dict, mappings: Mappings if property_name: break assert property_name - property_name = property_name.lower() + property_name = to_camel_case(property_name.lower()) + if property['type'] == 'int': + property_name = to_camel_case(block_data_burger['text_id']) + property_name return property_name # Find properties @@ -84,7 +86,7 @@ def generate_blocks(blocks_burger: dict, blocks_report: dict, mappings: Mappings property_struct_name = get_property_struct_name(property, block_data_burger) assert property_default is not None new_make_block_states_macro_code.append( - f' {to_camel_case(property_struct_name)}={to_camel_case(property_default)},') + f' {property_struct_name}={to_camel_case(property_default)},') # new_make_block_states_macro_code.append( # f' {to_camel_case(state)}=TODO,') new_make_block_states_macro_code.append(' },') diff --git a/codegen/lib/utils.py b/codegen/lib/utils.py index fb43af21..3887bb35 100644 --- a/codegen/lib/utils.py +++ b/codegen/lib/utils.py @@ -11,13 +11,15 @@ def to_snake_case(name: str): def to_camel_case(name: str): s = re.sub('_([a-z])', lambda m: m.group(1).upper(), name) - s = s[0].upper() + s[1:] + s = upper_first_letter(s) # if the first character is a number, we need to add an underscore # maybe we could convert it to the number name (like 2 would become "two")? if s[0].isdigit(): s = f'_{s}' return s +def upper_first_letter(name: str): + return name[0].upper() + name[1:] def padded_hex(n: int): return f'0x{n:02x}'