From 6be947e79d91479ddfc7f1199a81ebbc64658fac Mon Sep 17 00:00:00 2001 From: mat Date: Thu, 5 Mar 2026 12:12:44 +0400 Subject: don't unnecessarily disambiguate some block property enums --- azalea-block/src/generated.rs | 1557 ++++++----------------------------------- codegen/lib/code/blocks.py | 5 +- codegen/lib/download.py | 23 +- codegen/lib/extract.py | 24 +- 4 files changed, 255 insertions(+), 1354 deletions(-) diff --git a/azalea-block/src/generated.rs b/azalea-block/src/generated.rs index 092b00bd..85a911c1 100644 --- a/azalea-block/src/generated.rs +++ b/azalea-block/src/generated.rs @@ -17,35 +17,7 @@ make_block_states! { Y = "y", Z = "z", }, - "stage" => OakSaplingStage { - _0 = "0", - _1 = "1", - }, - "stage" => SpruceSaplingStage { - _0 = "0", - _1 = "1", - }, - "stage" => BirchSaplingStage { - _0 = "0", - _1 = "1", - }, - "stage" => JungleSaplingStage { - _0 = "0", - _1 = "1", - }, - "stage" => AcaciaSaplingStage { - _0 = "0", - _1 = "1", - }, - "stage" => CherrySaplingStage { - _0 = "0", - _1 = "1", - }, - "stage" => DarkOakSaplingStage { - _0 = "0", - _1 = "1", - }, - "stage" => PaleOakSaplingStage { + "stage" => Stage { _0 = "0", _1 = "1", }, @@ -57,10 +29,6 @@ make_block_states! { _4 = "4", }, "hanging" => Hanging(bool), - "stage" => MangrovePropaguleStage { - _0 = "0", - _1 = "1", - }, "waterlogged" => Waterlogged(bool), "level" => WaterLevel { _0 = "0", @@ -98,13 +66,7 @@ make_block_states! { _14 = "14", _15 = "15", }, - "dusted" => SuspiciousSandDusted { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - }, - "dusted" => SuspiciousGravelDusted { + "dusted" => Dusted { _0 = "0", _1 = "1", _2 = "2", @@ -244,7 +206,7 @@ make_block_states! { Piglin = "piglin", CustomHead = "custom_head", }, - "note" => NoteBlockNote { + "note" => Note { _0 = "0", _1 = "1", _2 = "2", @@ -369,7 +331,7 @@ make_block_states! { Side = "side", None = "none", }, - "power" => RedstoneWirePower { + "power" => Power { _0 = "0", _1 = "1", _2 = "2", @@ -407,7 +369,7 @@ make_block_states! { _6 = "6", _7 = "7", }, - "moisture" => FarmlandMoisture { + "moisture" => Moisture { _0 = "0", _1 = "1", _2 = "2", @@ -418,7 +380,7 @@ make_block_states! { _7 = "7", }, "lit" => Lit(bool), - "rotation" => OakSignRotation { + "rotation" => Rotation { _0 = "0", _1 = "1", _2 = "2", @@ -436,8 +398,30 @@ make_block_states! { _14 = "14", _15 = "15", }, - "rotation" => SpruceSignRotation { - _0 = "0", + "hinge" => Hinge { + Left = "left", + Right = "right", + }, + "open" => Open(bool), + "shape" => Shape { + NorthSouth = "north_south", + EastWest = "east_west", + AscendingEast = "ascending_east", + AscendingWest = "ascending_west", + AscendingNorth = "ascending_north", + AscendingSouth = "ascending_south", + SouthEast = "south_east", + SouthWest = "south_west", + NorthWest = "north_west", + NorthEast = "north_east", + }, + "attached" => Attached(bool), + "face" => Face { + Floor = "floor", + Wall = "wall", + Ceiling = "ceiling", + }, + "layers" => Layers { _1 = "1", _2 = "2", _3 = "3", @@ -446,15 +430,8 @@ make_block_states! { _6 = "6", _7 = "7", _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", }, - "rotation" => BirchSignRotation { + "age" => CactusAge { _0 = "0", _1 = "1", _2 = "2", @@ -472,7 +449,7 @@ make_block_states! { _14 = "14", _15 = "15", }, - "rotation" => AcaciaSignRotation { + "age" => SugarCaneAge { _0 = "0", _1 = "1", _2 = "2", @@ -490,7 +467,12 @@ make_block_states! { _14 = "14", _15 = "15", }, - "rotation" => CherrySignRotation { + "has_record" => HasRecord(bool), + "axis" => AxisXZ { + X = "x", + Z = "z", + }, + "bites" => Bites { _0 = "0", _1 = "1", _2 = "2", @@ -498,35 +480,16 @@ make_block_states! { _4 = "4", _5 = "5", _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", }, - "rotation" => JungleSignRotation { - _0 = "0", + "delay" => Delay { _1 = "1", _2 = "2", _3 = "3", _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", }, - "rotation" => DarkOakSignRotation { + "locked" => Locked(bool), + "down" => Down(bool), + "age" => PumpkinStemAge { _0 = "0", _1 = "1", _2 = "2", @@ -535,16 +498,8 @@ make_block_states! { _5 = "5", _6 = "6", _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", }, - "rotation" => PaleOakSignRotation { + "age" => MelonStemAge { _0 = "0", _1 = "1", _2 = "2", @@ -553,16 +508,61 @@ make_block_states! { _5 = "5", _6 = "6", _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", }, - "rotation" => MangroveSignRotation { + "in_wall" => InWall(bool), + "type" => Type { + Top = "top", + Bottom = "bottom", + Double = "double", + }, + "east" => WallEast { + None = "none", + Low = "low", + Tall = "tall", + }, + "north" => WallNorth { + None = "none", + Low = "low", + Tall = "tall", + }, + "south" => WallSouth { + None = "none", + Low = "low", + Tall = "tall", + }, + "west" => WallWest { + None = "none", + Low = "low", + Tall = "tall", + }, + "age" => NetherWartAge { + _0 = "0", + _1 = "1", + _2 = "2", + _3 = "3", + }, + "has_bottle_0" => HasBottle0(bool), + "has_bottle_1" => HasBottle1(bool), + "has_bottle_2" => HasBottle2(bool), + "level" => WaterCauldronLevel { + _1 = "1", + _2 = "2", + _3 = "3", + }, + "level" => PowderSnowCauldronLevel { + _1 = "1", + _2 = "2", + _3 = "3", + }, + "eye" => Eye(bool), + "age" => CocoaAge { + _0 = "0", + _1 = "1", + _2 = "2", + }, + "disarmed" => Disarmed(bool), + "conditional" => Conditional(bool), + "age" => CarrotsAge { _0 = "0", _1 = "1", _2 = "2", @@ -571,16 +571,8 @@ make_block_states! { _5 = "5", _6 = "6", _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", }, - "rotation" => BambooSignRotation { + "age" => PotatoesAge { _0 = "0", _1 = "1", _2 = "2", @@ -589,34 +581,21 @@ make_block_states! { _5 = "5", _6 = "6", _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", }, - "hinge" => Hinge { - Left = "left", - Right = "right", + "mode" => ComparatorType { + Compare = "compare", + Subtract = "subtract", }, - "open" => Open(bool), - "shape" => Shape { - NorthSouth = "north_south", - EastWest = "east_west", - AscendingEast = "ascending_east", - AscendingWest = "ascending_west", - AscendingNorth = "ascending_north", - AscendingSouth = "ascending_south", - SouthEast = "south_east", - SouthWest = "south_west", - NorthWest = "north_west", - NorthEast = "north_east", + "inverted" => Inverted(bool), + "enabled" => Enabled(bool), + "facing" => Facing { + Down = "down", + North = "north", + South = "south", + West = "west", + East = "east", }, - "attached" => Attached(bool), - "rotation" => OakHangingSignRotation { + "level" => LightLevel { _0 = "0", _1 = "1", _2 = "2", @@ -634,901 +613,38 @@ make_block_states! { _14 = "14", _15 = "15", }, - "rotation" => SpruceHangingSignRotation { + "age" => ChorusFlowerAge { _0 = "0", _1 = "1", _2 = "2", _3 = "3", _4 = "4", _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", }, - "rotation" => BirchHangingSignRotation { + "age" => TorchflowerCropAge { + _0 = "0", + _1 = "1", + }, + "age" => PitcherCropAge { _0 = "0", _1 = "1", _2 = "2", _3 = "3", _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", }, - "rotation" => AcaciaHangingSignRotation { + "age" => BeetrootsAge { + _0 = "0", + _1 = "1", + _2 = "2", + _3 = "3", + }, + "age" => FrostedIceAge { _0 = "0", _1 = "1", _2 = "2", _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", }, - "rotation" => CherryHangingSignRotation { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "rotation" => JungleHangingSignRotation { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "rotation" => DarkOakHangingSignRotation { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "rotation" => PaleOakHangingSignRotation { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "rotation" => CrimsonHangingSignRotation { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "rotation" => WarpedHangingSignRotation { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "rotation" => MangroveHangingSignRotation { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "rotation" => BambooHangingSignRotation { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "face" => Face { - Floor = "floor", - Wall = "wall", - Ceiling = "ceiling", - }, - "layers" => SnowLayers { - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - }, - "age" => CactusAge { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "age" => SugarCaneAge { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "has_record" => HasRecord(bool), - "axis" => AxisXZ { - X = "x", - Z = "z", - }, - "bites" => CakeBites { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - }, - "delay" => RepeaterDelay { - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - }, - "locked" => Locked(bool), - "down" => Down(bool), - "age" => PumpkinStemAge { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - }, - "age" => MelonStemAge { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - }, - "in_wall" => InWall(bool), - "type" => Type { - Top = "top", - Bottom = "bottom", - Double = "double", - }, - "east" => WallEast { - None = "none", - Low = "low", - Tall = "tall", - }, - "north" => WallNorth { - None = "none", - Low = "low", - Tall = "tall", - }, - "south" => WallSouth { - None = "none", - Low = "low", - Tall = "tall", - }, - "west" => WallWest { - None = "none", - Low = "low", - Tall = "tall", - }, - "age" => NetherWartAge { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - }, - "has_bottle_0" => HasBottle0(bool), - "has_bottle_1" => HasBottle1(bool), - "has_bottle_2" => HasBottle2(bool), - "level" => WaterCauldronLevel { - _1 = "1", - _2 = "2", - _3 = "3", - }, - "level" => PowderSnowCauldronLevel { - _1 = "1", - _2 = "2", - _3 = "3", - }, - "eye" => Eye(bool), - "age" => CocoaAge { - _0 = "0", - _1 = "1", - _2 = "2", - }, - "disarmed" => Disarmed(bool), - "conditional" => Conditional(bool), - "age" => CarrotsAge { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - }, - "age" => PotatoesAge { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - }, - "rotation" => SkeletonSkullRotation { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "rotation" => WitherSkeletonSkullRotation { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "rotation" => ZombieHeadRotation { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "rotation" => PlayerHeadRotation { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "rotation" => CreeperHeadRotation { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "rotation" => DragonHeadRotation { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "rotation" => PiglinHeadRotation { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "power" => LightWeightedPressurePlatePower { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "power" => HeavyWeightedPressurePlatePower { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "mode" => ComparatorType { - Compare = "compare", - Subtract = "subtract", - }, - "inverted" => Inverted(bool), - "power" => DaylightDetectorPower { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "enabled" => Enabled(bool), - "facing" => Facing { - Down = "down", - North = "north", - South = "south", - West = "west", - East = "east", - }, - "level" => LightLevel { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "rotation" => WhiteBannerRotation { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "rotation" => OrangeBannerRotation { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "rotation" => MagentaBannerRotation { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "rotation" => LightBlueBannerRotation { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "rotation" => YellowBannerRotation { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "rotation" => LimeBannerRotation { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "rotation" => PinkBannerRotation { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "rotation" => GrayBannerRotation { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "rotation" => LightGrayBannerRotation { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "rotation" => CyanBannerRotation { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "rotation" => PurpleBannerRotation { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "rotation" => BlueBannerRotation { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "rotation" => BrownBannerRotation { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "rotation" => GreenBannerRotation { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "rotation" => RedBannerRotation { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "rotation" => BlackBannerRotation { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "age" => ChorusFlowerAge { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - }, - "age" => TorchflowerCropAge { - _0 = "0", - _1 = "1", - }, - "age" => PitcherCropAge { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - }, - "age" => BeetrootsAge { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - }, - "age" => FrostedIceAge { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - }, - "age" => KelpAge { + "age" => KelpAge { _0 = "0", _1 = "1", _2 = "2", @@ -1556,29 +672,24 @@ make_block_states! { _24 = "24", _25 = "25", }, - "eggs" => TurtleEggEggs { + "eggs" => Eggs { _1 = "1", _2 = "2", _3 = "3", _4 = "4", }, - "hatch" => TurtleEggHatch { + "hatch" => Hatch { _0 = "0", _1 = "1", _2 = "2", }, - "hatch" => SnifferEggHatch { - _0 = "0", - _1 = "1", - _2 = "2", - }, - "hydration" => DriedGhastHydration { + "hydration" => Hydration { _0 = "0", _1 = "1", _2 = "2", _3 = "3", }, - "pickles" => SeaPicklePickles { + "pickles" => Pickles { _1 = "1", _2 = "2", _3 = "3", @@ -1593,10 +704,6 @@ make_block_states! { Small = "small", Large = "large", }, - "stage" => BambooStage { - _0 = "0", - _1 = "1", - }, "drag" => Drag(bool), "bottom" => Bottom(bool), "distance" => ScaffoldingDistance { @@ -1679,42 +786,6 @@ make_block_states! { _24 = "24", _25 = "25", }, - "rotation" => CrimsonSignRotation { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "rotation" => WarpedSignRotation { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, "mode" => StructureMode { Save = "save", Load = "load", @@ -1752,33 +823,7 @@ make_block_states! { _7 = "7", _8 = "8", }, - "power" => TargetPower { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, - "honey_level" => BeeNestHoneyLevel { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - }, - "honey_level" => BeehiveHoneyLevel { + "honey_level" => HoneyLevel { _0 = "0", _1 = "1", _2 = "2", @@ -1786,156 +831,24 @@ make_block_states! { _4 = "4", _5 = "5", }, - "charges" => RespawnAnchorCharges { + "charges" => Charges { _0 = "0", _1 = "1", _2 = "2", _3 = "3", _4 = "4", }, - "candles" => CandleCandles { - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - }, - "candles" => WhiteCandleCandles { - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - }, - "candles" => OrangeCandleCandles { - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - }, - "candles" => MagentaCandleCandles { - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - }, - "candles" => LightBlueCandleCandles { - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - }, - "candles" => YellowCandleCandles { - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - }, - "candles" => LimeCandleCandles { - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - }, - "candles" => PinkCandleCandles { - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - }, - "candles" => GrayCandleCandles { - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - }, - "candles" => LightGrayCandleCandles { - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - }, - "candles" => CyanCandleCandles { - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - }, - "candles" => PurpleCandleCandles { + "candles" => Candles { _1 = "1", _2 = "2", _3 = "3", _4 = "4", }, - "candles" => BlueCandleCandles { - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - }, - "candles" => BrownCandleCandles { - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - }, - "candles" => GreenCandleCandles { - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - }, - "candles" => RedCandleCandles { - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - }, - "candles" => BlackCandleCandles { - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - }, - "power" => SculkSensorPower { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, "sculk_sensor_phase" => SculkSensorPhase { Inactive = "inactive", Active = "active", Cooldown = "cooldown", }, - "power" => CalibratedSculkSensorPower { - _0 = "0", - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - _5 = "5", - _6 = "6", - _7 = "7", - _8 = "8", - _9 = "9", - _10 = "10", - _11 = "11", - _12 = "12", - _13 = "13", - _14 = "14", - _15 = "15", - }, "bloom" => Bloom(bool), "can_summon" => CanSummon(bool), "shrieking" => Shrieking(bool), @@ -1985,19 +898,13 @@ make_block_states! { _25 = "25", }, "berries" => Berries(bool), - "flower_amount" => PinkPetalsFlowerAmount { - _1 = "1", - _2 = "2", - _3 = "3", - _4 = "4", - }, - "flower_amount" => WildflowersFlowerAmount { + "flower_amount" => FlowerAmount { _1 = "1", _2 = "2", _3 = "3", _4 = "4", }, - "segment_amount" => LeafLitterSegmentAmount { + "segment_amount" => SegmentAmount { _1 = "1", _2 = "2", _3 = "3", @@ -2061,33 +968,33 @@ make_block_states! { bamboo_planks => BlockBehavior::new().strength(2.0, 3.0), {}, bamboo_mosaic => BlockBehavior::new().strength(2.0, 3.0), {}, oak_sapling => BlockBehavior::new(), { - "stage": OakSaplingStage::_0, + "stage": Stage::_0, }, spruce_sapling => BlockBehavior::new(), { - "stage": SpruceSaplingStage::_0, + "stage": Stage::_0, }, birch_sapling => BlockBehavior::new(), { - "stage": BirchSaplingStage::_0, + "stage": Stage::_0, }, jungle_sapling => BlockBehavior::new(), { - "stage": JungleSaplingStage::_0, + "stage": Stage::_0, }, acacia_sapling => BlockBehavior::new(), { - "stage": AcaciaSaplingStage::_0, + "stage": Stage::_0, }, cherry_sapling => BlockBehavior::new(), { - "stage": CherrySaplingStage::_0, + "stage": Stage::_0, }, dark_oak_sapling => BlockBehavior::new(), { - "stage": DarkOakSaplingStage::_0, + "stage": Stage::_0, }, pale_oak_sapling => BlockBehavior::new(), { - "stage": PaleOakSaplingStage::_0, + "stage": Stage::_0, }, mangrove_propagule => BlockBehavior::new(), { "age": MangrovePropaguleAge::_0, "hanging": Hanging(false), - "stage": MangrovePropaguleStage::_0, + "stage": Stage::_0, "waterlogged": Waterlogged(false), }, bedrock => BlockBehavior::new().strength(-1.0, 3600000.0), {}, @@ -2099,12 +1006,12 @@ make_block_states! { }, sand => BlockBehavior::new().strength(0.5, 0.5), {}, suspicious_sand => BlockBehavior::new().strength(0.25, 0.25), { - "dusted": SuspiciousSandDusted::_0, + "dusted": Dusted::_0, }, red_sand => BlockBehavior::new().strength(0.5, 0.5), {}, gravel => BlockBehavior::new().strength(0.6, 0.6), {}, suspicious_gravel => BlockBehavior::new().strength(0.25, 0.25), { - "dusted": SuspiciousGravelDusted::_0, + "dusted": Dusted::_0, }, gold_ore => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.0, 3.0), {}, deepslate_gold_ore => BlockBehavior::new().requires_correct_tool_for_drops().strength(4.5, 3.0), {}, @@ -2300,7 +1207,7 @@ make_block_states! { cut_sandstone => BlockBehavior::new().requires_correct_tool_for_drops().strength(0.8, 0.8), {}, note_block => BlockBehavior::new().strength(0.8, 0.8), { "instrument": Sound::Harp, - "note": NoteBlockNote::_0, + "note": Note::_0, "powered": Powered(false), }, white_bed => BlockBehavior::new().strength(0.2, 0.2), { @@ -2576,7 +1483,7 @@ make_block_states! { redstone_wire => BlockBehavior::new(), { "east": WireEast::None, "north": WireNorth::None, - "power": RedstoneWirePower::_0, + "power": Power::_0, "south": WireSouth::None, "west": WireWest::None, }, @@ -2588,50 +1495,50 @@ make_block_states! { "age": WheatAge::_0, }, farmland => BlockBehavior::new().strength(0.6, 0.6), { - "moisture": FarmlandMoisture::_0, + "moisture": Moisture::_0, }, furnace => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.5, 3.5), { "facing": FacingCardinal::North, "lit": Lit(false), }, oak_sign => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { - "rotation": OakSignRotation::_0, + "rotation": Rotation::_0, "waterlogged": Waterlogged(false), }, spruce_sign => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { - "rotation": SpruceSignRotation::_0, + "rotation": Rotation::_0, "waterlogged": Waterlogged(false), }, birch_sign => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { - "rotation": BirchSignRotation::_0, + "rotation": Rotation::_0, "waterlogged": Waterlogged(false), }, acacia_sign => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { - "rotation": AcaciaSignRotation::_0, + "rotation": Rotation::_0, "waterlogged": Waterlogged(false), }, cherry_sign => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { - "rotation": CherrySignRotation::_0, + "rotation": Rotation::_0, "waterlogged": Waterlogged(false), }, jungle_sign => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { - "rotation": JungleSignRotation::_0, + "rotation": Rotation::_0, "waterlogged": Waterlogged(false), }, dark_oak_sign => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { - "rotation": DarkOakSignRotation::_0, + "rotation": Rotation::_0, "waterlogged": Waterlogged(false), }, pale_oak_sign => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { - "rotation": PaleOakSignRotation::_0, + "rotation": Rotation::_0, "waterlogged": Waterlogged(false), }, mangrove_sign => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { - "rotation": MangroveSignRotation::_0, + "rotation": Rotation::_0, "waterlogged": Waterlogged(false), }, bamboo_sign => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { - "rotation": BambooSignRotation::_0, + "rotation": Rotation::_0, "waterlogged": Waterlogged(false), }, oak_door => BlockBehavior::new().strength(3.0, 3.0), { @@ -2697,62 +1604,62 @@ make_block_states! { }, oak_hanging_sign => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { "attached": Attached(false), - "rotation": OakHangingSignRotation::_0, + "rotation": Rotation::_0, "waterlogged": Waterlogged(false), }, spruce_hanging_sign => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { "attached": Attached(false), - "rotation": SpruceHangingSignRotation::_0, + "rotation": Rotation::_0, "waterlogged": Waterlogged(false), }, birch_hanging_sign => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { "attached": Attached(false), - "rotation": BirchHangingSignRotation::_0, + "rotation": Rotation::_0, "waterlogged": Waterlogged(false), }, acacia_hanging_sign => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { "attached": Attached(false), - "rotation": AcaciaHangingSignRotation::_0, + "rotation": Rotation::_0, "waterlogged": Waterlogged(false), }, cherry_hanging_sign => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { "attached": Attached(false), - "rotation": CherryHangingSignRotation::_0, + "rotation": Rotation::_0, "waterlogged": Waterlogged(false), }, jungle_hanging_sign => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { "attached": Attached(false), - "rotation": JungleHangingSignRotation::_0, + "rotation": Rotation::_0, "waterlogged": Waterlogged(false), }, dark_oak_hanging_sign => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { "attached": Attached(false), - "rotation": DarkOakHangingSignRotation::_0, + "rotation": Rotation::_0, "waterlogged": Waterlogged(false), }, pale_oak_hanging_sign => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { "attached": Attached(false), - "rotation": PaleOakHangingSignRotation::_0, + "rotation": Rotation::_0, "waterlogged": Waterlogged(false), }, crimson_hanging_sign => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { "attached": Attached(false), - "rotation": CrimsonHangingSignRotation::_0, + "rotation": Rotation::_0, "waterlogged": Waterlogged(false), }, warped_hanging_sign => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { "attached": Attached(false), - "rotation": WarpedHangingSignRotation::_0, + "rotation": Rotation::_0, "waterlogged": Waterlogged(false), }, mangrove_hanging_sign => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { "attached": Attached(false), - "rotation": MangroveHangingSignRotation::_0, + "rotation": Rotation::_0, "waterlogged": Waterlogged(false), }, bamboo_hanging_sign => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { "attached": Attached(false), - "rotation": BambooHangingSignRotation::_0, + "rotation": Rotation::_0, "waterlogged": Waterlogged(false), }, oak_wall_hanging_sign => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { @@ -2867,7 +1774,7 @@ make_block_states! { "powered": Powered(false), }, snow => BlockBehavior::new().requires_correct_tool_for_drops().strength(0.1, 0.1).force_solid(false), { - "layers": SnowLayers::_1, + "layers": Layers::_1, }, ice => BlockBehavior::new().strength(0.5, 0.5).friction(0.98), {}, snow_block => BlockBehavior::new().requires_correct_tool_for_drops().strength(0.2, 0.2), {}, @@ -2917,10 +1824,10 @@ make_block_states! { "facing": FacingCardinal::North, }, cake => BlockBehavior::new().strength(0.5, 0.5).force_solid(true), { - "bites": CakeBites::_0, + "bites": Bites::_0, }, repeater => BlockBehavior::new(), { - "delay": RepeaterDelay::_1, + "delay": Delay::_1, "facing": FacingCardinal::North, "locked": Locked(false), "powered": Powered(false), @@ -3439,7 +2346,7 @@ make_block_states! { }, skeleton_skull => BlockBehavior::new().strength(1.0, 1.0), { "powered": Powered(false), - "rotation": SkeletonSkullRotation::_0, + "rotation": Rotation::_0, }, skeleton_wall_skull => BlockBehavior::new().strength(1.0, 1.0), { "facing": FacingCardinal::North, @@ -3447,7 +2354,7 @@ make_block_states! { }, wither_skeleton_skull => BlockBehavior::new().strength(1.0, 1.0), { "powered": Powered(false), - "rotation": WitherSkeletonSkullRotation::_0, + "rotation": Rotation::_0, }, wither_skeleton_wall_skull => BlockBehavior::new().strength(1.0, 1.0), { "facing": FacingCardinal::North, @@ -3455,7 +2362,7 @@ make_block_states! { }, zombie_head => BlockBehavior::new().strength(1.0, 1.0), { "powered": Powered(false), - "rotation": ZombieHeadRotation::_0, + "rotation": Rotation::_0, }, zombie_wall_head => BlockBehavior::new().strength(1.0, 1.0), { "facing": FacingCardinal::North, @@ -3463,7 +2370,7 @@ make_block_states! { }, player_head => BlockBehavior::new().strength(1.0, 1.0), { "powered": Powered(false), - "rotation": PlayerHeadRotation::_0, + "rotation": Rotation::_0, }, player_wall_head => BlockBehavior::new().strength(1.0, 1.0), { "facing": FacingCardinal::North, @@ -3471,7 +2378,7 @@ make_block_states! { }, creeper_head => BlockBehavior::new().strength(1.0, 1.0), { "powered": Powered(false), - "rotation": CreeperHeadRotation::_0, + "rotation": Rotation::_0, }, creeper_wall_head => BlockBehavior::new().strength(1.0, 1.0), { "facing": FacingCardinal::North, @@ -3479,7 +2386,7 @@ make_block_states! { }, dragon_head => BlockBehavior::new().strength(1.0, 1.0), { "powered": Powered(false), - "rotation": DragonHeadRotation::_0, + "rotation": Rotation::_0, }, dragon_wall_head => BlockBehavior::new().strength(1.0, 1.0), { "facing": FacingCardinal::North, @@ -3487,7 +2394,7 @@ make_block_states! { }, piglin_head => BlockBehavior::new().strength(1.0, 1.0), { "powered": Powered(false), - "rotation": PiglinHeadRotation::_0, + "rotation": Rotation::_0, }, piglin_wall_head => BlockBehavior::new().strength(1.0, 1.0), { "facing": FacingCardinal::North, @@ -3508,10 +2415,10 @@ make_block_states! { "waterlogged": Waterlogged(false), }, light_weighted_pressure_plate => BlockBehavior::new().strength(0.5, 0.5).force_solid(true), { - "power": LightWeightedPressurePlatePower::_0, + "power": Power::_0, }, heavy_weighted_pressure_plate => BlockBehavior::new().strength(0.5, 0.5).force_solid(true), { - "power": HeavyWeightedPressurePlatePower::_0, + "power": Power::_0, }, comparator => BlockBehavior::new(), { "facing": FacingCardinal::North, @@ -3520,7 +2427,7 @@ make_block_states! { }, daylight_detector => BlockBehavior::new().strength(0.2, 0.2), { "inverted": Inverted(false), - "power": DaylightDetectorPower::_0, + "power": Power::_0, }, redstone_block => BlockBehavior::new().requires_correct_tool_for_drops().strength(5.0, 6.0), {}, nether_quartz_ore => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.0, 3.0), {}, @@ -3808,52 +2715,52 @@ make_block_states! { "half": Half::Lower, }, white_banner => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { - "rotation": WhiteBannerRotation::_0, + "rotation": Rotation::_0, }, orange_banner => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { - "rotation": OrangeBannerRotation::_0, + "rotation": Rotation::_0, }, magenta_banner => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { - "rotation": MagentaBannerRotation::_0, + "rotation": Rotation::_0, }, light_blue_banner => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { - "rotation": LightBlueBannerRotation::_0, + "rotation": Rotation::_0, }, yellow_banner => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { - "rotation": YellowBannerRotation::_0, + "rotation": Rotation::_0, }, lime_banner => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { - "rotation": LimeBannerRotation::_0, + "rotation": Rotation::_0, }, pink_banner => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { - "rotation": PinkBannerRotation::_0, + "rotation": Rotation::_0, }, gray_banner => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { - "rotation": GrayBannerRotation::_0, + "rotation": Rotation::_0, }, light_gray_banner => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { - "rotation": LightGrayBannerRotation::_0, + "rotation": Rotation::_0, }, cyan_banner => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { - "rotation": CyanBannerRotation::_0, + "rotation": Rotation::_0, }, purple_banner => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { - "rotation": PurpleBannerRotation::_0, + "rotation": Rotation::_0, }, blue_banner => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { - "rotation": BlueBannerRotation::_0, + "rotation": Rotation::_0, }, brown_banner => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { - "rotation": BrownBannerRotation::_0, + "rotation": Rotation::_0, }, green_banner => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { - "rotation": GreenBannerRotation::_0, + "rotation": Rotation::_0, }, red_banner => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { - "rotation": RedBannerRotation::_0, + "rotation": Rotation::_0, }, black_banner => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { - "rotation": BlackBannerRotation::_0, + "rotation": Rotation::_0, }, white_wall_banner => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { "facing": FacingCardinal::North, @@ -4395,15 +3302,15 @@ make_block_states! { kelp_plant => BlockBehavior::new(), {}, dried_kelp_block => BlockBehavior::new().strength(0.5, 2.5), {}, turtle_egg => BlockBehavior::new().strength(0.5, 0.5).force_solid(true), { - "eggs": TurtleEggEggs::_1, - "hatch": TurtleEggHatch::_0, + "eggs": Eggs::_1, + "hatch": Hatch::_0, }, sniffer_egg => BlockBehavior::new().strength(0.5, 0.5), { - "hatch": SnifferEggHatch::_0, + "hatch": Hatch::_0, }, dried_ghast => BlockBehavior::new().force_solid(true), { "facing": FacingCardinal::North, - "hydration": DriedGhastHydration::_0, + "hydration": Hydration::_0, "waterlogged": Waterlogged(false), }, dead_tube_coral_block => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0).force_solid(true), {}, @@ -4517,7 +3424,7 @@ make_block_states! { "waterlogged": Waterlogged(true), }, sea_pickle => BlockBehavior::new(), { - "pickles": SeaPicklePickles::_1, + "pickles": Pickles::_1, "waterlogged": Waterlogged(true), }, blue_ice => BlockBehavior::new().strength(2.8, 2.8).friction(0.989), {}, @@ -4528,7 +3435,7 @@ make_block_states! { bamboo => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { "age": BambooAge::_0, "leaves": Leaves::None, - "stage": BambooStage::_0, + "stage": Stage::_0, }, potted_bamboo => BlockBehavior::new(), {}, void_air => BlockBehavior::new(), {}, @@ -5005,11 +3912,11 @@ make_block_states! { "powered": Powered(false), }, crimson_sign => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { - "rotation": CrimsonSignRotation::_0, + "rotation": Rotation::_0, "waterlogged": Waterlogged(false), }, warped_sign => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { - "rotation": WarpedSignRotation::_0, + "rotation": Rotation::_0, "waterlogged": Waterlogged(false), }, crimson_wall_sign => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), { @@ -5034,15 +3941,15 @@ make_block_states! { "level": ComposterLevel::_0, }, target => BlockBehavior::new().strength(0.5, 0.5), { - "power": TargetPower::_0, + "power": Power::_0, }, bee_nest => BlockBehavior::new().strength(0.3, 0.3), { "facing": FacingCardinal::North, - "honey_level": BeeNestHoneyLevel::_0, + "honey_level": HoneyLevel::_0, }, beehive => BlockBehavior::new().strength(0.6, 0.6), { "facing": FacingCardinal::North, - "honey_level": BeehiveHoneyLevel::_0, + "honey_level": HoneyLevel::_0, }, honey_block => BlockBehavior::new(), {}, honeycomb_block => BlockBehavior::new().strength(0.6, 0.6), {}, @@ -5050,7 +3957,7 @@ make_block_states! { ancient_debris => BlockBehavior::new().requires_correct_tool_for_drops().strength(30.0, 1200.0), {}, crying_obsidian => BlockBehavior::new().requires_correct_tool_for_drops().strength(50.0, 1200.0), {}, respawn_anchor => BlockBehavior::new().requires_correct_tool_for_drops().strength(50.0, 1200.0), { - "charges": RespawnAnchorCharges::_0, + "charges": Charges::_0, }, potted_crimson_fungus => BlockBehavior::new(), {}, potted_warped_fungus => BlockBehavior::new(), {}, @@ -5129,87 +4036,87 @@ make_block_states! { cracked_nether_bricks => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), {}, quartz_bricks => BlockBehavior::new().requires_correct_tool_for_drops().strength(0.8, 0.8), {}, candle => BlockBehavior::new().strength(0.1, 0.1), { - "candles": CandleCandles::_1, + "candles": Candles::_1, "lit": Lit(false), "waterlogged": Waterlogged(false), }, white_candle => BlockBehavior::new().strength(0.1, 0.1), { - "candles": WhiteCandleCandles::_1, + "candles": Candles::_1, "lit": Lit(false), "waterlogged": Waterlogged(false), }, orange_candle => BlockBehavior::new().strength(0.1, 0.1), { - "candles": OrangeCandleCandles::_1, + "candles": Candles::_1, "lit": Lit(false), "waterlogged": Waterlogged(false), }, magenta_candle => BlockBehavior::new().strength(0.1, 0.1), { - "candles": MagentaCandleCandles::_1, + "candles": Candles::_1, "lit": Lit(false), "waterlogged": Waterlogged(false), }, light_blue_candle => BlockBehavior::new().strength(0.1, 0.1), { - "candles": LightBlueCandleCandles::_1, + "candles": Candles::_1, "lit": Lit(false), "waterlogged": Waterlogged(false), }, yellow_candle => BlockBehavior::new().strength(0.1, 0.1), { - "candles": YellowCandleCandles::_1, + "candles": Candles::_1, "lit": Lit(false), "waterlogged": Waterlogged(false), }, lime_candle => BlockBehavior::new().strength(0.1, 0.1), { - "candles": LimeCandleCandles::_1, + "candles": Candles::_1, "lit": Lit(false), "waterlogged": Waterlogged(false), }, pink_candle => BlockBehavior::new().strength(0.1, 0.1), { - "candles": PinkCandleCandles::_1, + "candles": Candles::_1, "lit": Lit(false), "waterlogged": Waterlogged(false), }, gray_candle => BlockBehavior::new().strength(0.1, 0.1), { - "candles": GrayCandleCandles::_1, + "candles": Candles::_1, "lit": Lit(false), "waterlogged": Waterlogged(false), }, light_gray_candle => BlockBehavior::new().strength(0.1, 0.1), { - "candles": LightGrayCandleCandles::_1, + "candles": Candles::_1, "lit": Lit(false), "waterlogged": Waterlogged(false), }, cyan_candle => BlockBehavior::new().strength(0.1, 0.1), { - "candles": CyanCandleCandles::_1, + "candles": Candles::_1, "lit": Lit(false), "waterlogged": Waterlogged(false), }, purple_candle => BlockBehavior::new().strength(0.1, 0.1), { - "candles": PurpleCandleCandles::_1, + "candles": Candles::_1, "lit": Lit(false), "waterlogged": Waterlogged(false), }, blue_candle => BlockBehavior::new().strength(0.1, 0.1), { - "candles": BlueCandleCandles::_1, + "candles": Candles::_1, "lit": Lit(false), "waterlogged": Waterlogged(false), }, brown_candle => BlockBehavior::new().strength(0.1, 0.1), { - "candles": BrownCandleCandles::_1, + "candles": Candles::_1, "lit": Lit(false), "waterlogged": Waterlogged(false), }, green_candle => BlockBehavior::new().strength(0.1, 0.1), { - "candles": GreenCandleCandles::_1, + "candles": Candles::_1, "lit": Lit(false), "waterlogged": Waterlogged(false), }, red_candle => BlockBehavior::new().strength(0.1, 0.1), { - "candles": RedCandleCandles::_1, + "candles": Candles::_1, "lit": Lit(false), "waterlogged": Waterlogged(false), }, black_candle => BlockBehavior::new().strength(0.1, 0.1), { - "candles": BlackCandleCandles::_1, + "candles": Candles::_1, "lit": Lit(false), "waterlogged": Waterlogged(false), }, @@ -5345,13 +4252,13 @@ make_block_states! { tinted_glass => BlockBehavior::new().strength(0.3, 0.3), {}, powder_snow => BlockBehavior::new().strength(0.25, 0.25), {}, sculk_sensor => BlockBehavior::new().strength(1.5, 1.5), { - "power": SculkSensorPower::_0, + "power": Power::_0, "sculk_sensor_phase": SculkSensorPhase::Inactive, "waterlogged": Waterlogged(false), }, calibrated_sculk_sensor => BlockBehavior::new().strength(1.5, 1.5), { "facing": FacingCardinal::North, - "power": CalibratedSculkSensorPower::_0, + "power": Power::_0, "sculk_sensor_phase": SculkSensorPhase::Inactive, "waterlogged": Waterlogged(false), }, @@ -5786,15 +4693,15 @@ make_block_states! { moss_carpet => BlockBehavior::new().strength(0.1, 0.1), {}, pink_petals => BlockBehavior::new(), { "facing": FacingCardinal::North, - "flower_amount": PinkPetalsFlowerAmount::_1, + "flower_amount": FlowerAmount::_1, }, wildflowers => BlockBehavior::new(), { "facing": FacingCardinal::North, - "flower_amount": WildflowersFlowerAmount::_1, + "flower_amount": FlowerAmount::_1, }, leaf_litter => BlockBehavior::new(), { "facing": FacingCardinal::North, - "segment_amount": LeafLitterSegmentAmount::_1, + "segment_amount": SegmentAmount::_1, }, moss_block => BlockBehavior::new().strength(0.1, 0.1), {}, big_dripleaf => BlockBehavior::new().strength(0.1, 0.1).force_solid(false), { diff --git a/codegen/lib/code/blocks.py b/codegen/lib/code/blocks.py index e3becfe5..722a0581 100644 --- a/codegen/lib/code/blocks.py +++ b/codegen/lib/code/blocks.py @@ -236,13 +236,12 @@ def get_property_struct_name( return "StructureMode" if "harp" in property_variants and "didgeridoo" in property_variants: return "Sound" - if is_list_of_string_integers(property_variants): - # if the values are all integers, then prepend the block name - return to_camel_case(block_id) + to_camel_case(property_id) if property_variants == ["up", "side", "none"]: return "Wire" + to_camel_case(property_id) if property_variants == ["none", "low", "tall"]: return "Wall" + to_camel_case(property_id) + if property_id in {"age", "level", "distance"}: + return to_camel_case(block_id) + to_camel_case(property_id) return to_camel_case(property_id) diff --git a/codegen/lib/download.py b/codegen/lib/download.py index fa963188..8819cf61 100644 --- a/codegen/lib/download.py +++ b/codegen/lib/download.py @@ -5,6 +5,9 @@ import requests import json import os +PUMPKIN_EXTRACTOR_COMMIT = "82926545925baf5f50414cc9374f1cc340b7de0f" +BURGER_COMMIT = "366d6e4bed0e9e6505d9c40c83628ab80a5fe001" + # make sure the cache directory exists print("Making __cache__") if not os.path.exists(get_dir_location("__cache__")): @@ -16,7 +19,7 @@ def get_burger(): if not os.path.exists(get_dir_location("__cache__/Burger")): print("\033[92mDownloading Burger...\033[m") os.system( - f"cd {get_dir_location('__cache__')} && git clone https://github.com/mat-1/Burger && cd Burger && git pull" + f"cd {get_dir_location('__cache__')} && git clone https://github.com/mat-1/Burger && cd Burger && git pull && git reset --hard {BURGER_COMMIT}" ) print("\033[92mInstalling dependencies...\033[m") @@ -29,7 +32,7 @@ def get_pumpkin_extractor(): if not os.path.exists(get_dir_location("__cache__/pumpkin-extractor")): print("\033[92mDownloading Pumpkin-MC/Extractor...\033[m") os.system( - f"cd {get_dir_location('__cache__')} && git clone https://github.com/Pumpkin-MC/Extractor pumpkin-extractor && cd pumpkin-extractor && git pull" + f"cd {get_dir_location('__cache__')} && git clone https://github.com/Pumpkin-MC/Extractor pumpkin-extractor && cd pumpkin-extractor && git pull && git reset --hard {PUMPKIN_EXTRACTOR_COMMIT}" ) return get_dir_location("__cache__/pumpkin-extractor") @@ -123,7 +126,7 @@ def get_fabric_data(version_id: str): return yarn_versions_data -def get_latest_fabric_api_version(): +def get_fabric_api_version(version_id: str): path = get_dir_location("__cache__/fabric-api-maven-metadata.xml") if not os.path.exists(path): @@ -137,10 +140,12 @@ def get_latest_fabric_api_version(): maven_metadata_xml = json.load(f) tree = ET.ElementTree(ET.fromstring(maven_metadata_xml)) - name = tree.find(".//latest").text - if name.endswith('_unobfuscated'): - name = name[:-len('_unobfuscated')] - return name + expected_suffix = "+" + version_id.split("-")[0] + versions = tree.findall(".//version") + for candidate in reversed(versions): + candidate = candidate.text + if candidate.endswith(expected_suffix): + return candidate def get_latest_fabric_kotlin_version(): @@ -244,9 +249,9 @@ def clear_version_cache(): burger_path = get_dir_location("__cache__/Burger") if os.path.exists(burger_path): - os.system(f"cd {burger_path} && git pull") + os.system(f"cd {burger_path} && git pull && git reset --hard {BURGER_COMMIT}") pumpkin_path = get_dir_location("__cache__/pumpkin-extractor") if os.path.exists(pumpkin_path): os.system( - f"cd {pumpkin_path} && git add . && git stash && git pull && git stash pop && git checkout HEAD -- src/main/resources/fabric.mod.json" + f"cd {pumpkin_path} && git add . && git stash && git checkout master && git pull && git stash pop && git reset --hard {PUMPKIN_EXTRACTOR_COMMIT}" ) diff --git a/codegen/lib/extract.py b/codegen/lib/extract.py index b07e17ba..f2f7f4a2 100644 --- a/codegen/lib/extract.py +++ b/codegen/lib/extract.py @@ -2,7 +2,7 @@ import shutil from lib.download import ( - get_latest_fabric_api_version, + get_fabric_api_version, get_latest_fabric_kotlin_version, get_latest_fabric_loom_version, get_mappings_for_version, @@ -179,9 +179,8 @@ def get_pumpkin_data(version_id: str, category: str): f.write("server-port=0") fabric_data = get_fabric_data(version_id)[0] - fabric_api_version = get_latest_fabric_api_version() + fabric_api_version = get_fabric_api_version(version_id) fabric_kotlin_version = get_latest_fabric_kotlin_version() - fabric_loom_version = get_latest_fabric_loom_version() gradle_properties = f"""# Done to increase the memory available to gradle. org.gradle.jvmargs=-Xmx1G @@ -205,23 +204,14 @@ fabric_version={fabric_api_version} fabric_mod_json_path = f"{pumpkin_dir}/src/main/resources/fabric.mod.json" with open(fabric_mod_json_path, "r") as f: fabric_mod_json = f.read() - with open(fabric_mod_json_path, "w") as f: - fabric_mod_json = fabric_mod_json.replace( - '"minecraft": "${minecraft_version}"', '"minecraft": "*"' - ) - f.write(fabric_mod_json) with open(f"{pumpkin_dir}/build.gradle.kts", "r") as f: build_gradle_kts = f.read() with open(f"{pumpkin_dir}/build.gradle.kts", "w") as f: - build_gradle_kts = re.sub( - r'(id\("fabric-loom"\) version )"[^"]+"', - rf'\1"{fabric_loom_version}"', - build_gradle_kts, - ) - # kotlin complains about nullable types if we don't add this - build_gradle_kts = re.sub( - r'(to project.property\("\w+"\))([\n,])', r"\1!!\2", build_gradle_kts - ) + # build_gradle_kts = re.sub( + # r'(id\("fabric-loom"\) version )"[^"]+"', + # rf'\1"{fabric_loom_version}"', + # build_gradle_kts, + # ) f.write(build_gradle_kts) # run ./gradlew runServer until it logs "(pumpkin_extractor) Done" -- cgit v1.2.3