diff options
| author | urisinger <60300761+urisinger@users.noreply.github.com> | 2025-09-15 07:51:50 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-14 23:51:50 -0500 |
| commit | bcefd0213db05b4c29c82a1031f4d6e838e1fc1f (patch) | |
| tree | 563797281982fbcced3491e8b3096448903fddc9 /azalea-block/src | |
| parent | 3a58a39563a596e3b08ad41e93070c84e205bddb (diff) | |
| download | azalea-drasl-bcefd0213db05b4c29c82a1031f4d6e838e1fc1f.tar.xz | |
Add functions for getting block properties as strings (#240)
* add tests and fix
* fix integer properties
* refactor azalea-block-macros and improve apis
---------
Co-authored-by: mat <git@matdoes.dev>
Diffstat (limited to 'azalea-block/src')
| -rw-r--r-- | azalea-block/src/generated.rs | 3202 | ||||
| -rw-r--r-- | azalea-block/src/lib.rs | 82 |
2 files changed, 1676 insertions, 1608 deletions
diff --git a/azalea-block/src/generated.rs b/azalea-block/src/generated.rs index f7ec4e6c..cd5fb011 100644 --- a/azalea-block/src/generated.rs +++ b/azalea-block/src/generated.rs @@ -13,292 +13,292 @@ make_block_states! { Properties => { "snowy" => Snowy(bool), "axis" => Axis { - X, - Y, - Z, + X = "x", + Y = "y", + Z = "z", }, "stage" => OakSaplingStage { - _0, - _1, + _0 = "0", + _1 = "1", }, "stage" => SpruceSaplingStage { - _0, - _1, + _0 = "0", + _1 = "1", }, "stage" => BirchSaplingStage { - _0, - _1, + _0 = "0", + _1 = "1", }, "stage" => JungleSaplingStage { - _0, - _1, + _0 = "0", + _1 = "1", }, "stage" => AcaciaSaplingStage { - _0, - _1, + _0 = "0", + _1 = "1", }, "stage" => CherrySaplingStage { - _0, - _1, + _0 = "0", + _1 = "1", }, "stage" => DarkOakSaplingStage { - _0, - _1, + _0 = "0", + _1 = "1", }, "stage" => PaleOakSaplingStage { - _0, - _1, + _0 = "0", + _1 = "1", }, "age" => MangrovePropaguleAge { - _0, - _1, - _2, - _3, - _4, + _0 = "0", + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", }, "hanging" => Hanging(bool), "stage" => MangrovePropaguleStage { - _0, - _1, + _0 = "0", + _1 = "1", }, "waterlogged" => Waterlogged(bool), "level" => WaterLevel { - _0, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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", }, "level" => LavaLevel { - _0, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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", }, "dusted" => SuspiciousSandDusted { - _0, - _1, - _2, - _3, + _0 = "0", + _1 = "1", + _2 = "2", + _3 = "3", }, "dusted" => SuspiciousGravelDusted { - _0, - _1, - _2, - _3, + _0 = "0", + _1 = "1", + _2 = "2", + _3 = "3", }, "distance" => OakLeavesDistance { - _1, - _2, - _3, - _4, - _5, - _6, - _7, + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", + _5 = "5", + _6 = "6", + _7 = "7", }, "persistent" => Persistent(bool), "distance" => SpruceLeavesDistance { - _1, - _2, - _3, - _4, - _5, - _6, - _7, + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", + _5 = "5", + _6 = "6", + _7 = "7", }, "distance" => BirchLeavesDistance { - _1, - _2, - _3, - _4, - _5, - _6, - _7, + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", + _5 = "5", + _6 = "6", + _7 = "7", }, "distance" => JungleLeavesDistance { - _1, - _2, - _3, - _4, - _5, - _6, - _7, + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", + _5 = "5", + _6 = "6", + _7 = "7", }, "distance" => AcaciaLeavesDistance { - _1, - _2, - _3, - _4, - _5, - _6, - _7, + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", + _5 = "5", + _6 = "6", + _7 = "7", }, "distance" => CherryLeavesDistance { - _1, - _2, - _3, - _4, - _5, - _6, - _7, + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", + _5 = "5", + _6 = "6", + _7 = "7", }, "distance" => DarkOakLeavesDistance { - _1, - _2, - _3, - _4, - _5, - _6, - _7, + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", + _5 = "5", + _6 = "6", + _7 = "7", }, "distance" => PaleOakLeavesDistance { - _1, - _2, - _3, - _4, - _5, - _6, - _7, + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", + _5 = "5", + _6 = "6", + _7 = "7", }, "distance" => MangroveLeavesDistance { - _1, - _2, - _3, - _4, - _5, - _6, - _7, + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", + _5 = "5", + _6 = "6", + _7 = "7", }, "distance" => AzaleaLeavesDistance { - _1, - _2, - _3, - _4, - _5, - _6, - _7, + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", + _5 = "5", + _6 = "6", + _7 = "7", }, "distance" => FloweringAzaleaLeavesDistance { - _1, - _2, - _3, - _4, - _5, - _6, - _7, + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", + _5 = "5", + _6 = "6", + _7 = "7", }, "facing" => FacingCubic { - North, - East, - South, - West, - Up, - Down, + North = "north", + East = "east", + South = "south", + West = "west", + Up = "up", + Down = "down", }, "triggered" => Triggered(bool), "instrument" => Sound { - Harp, - Basedrum, - Snare, - Hat, - Bass, - Flute, - Bell, - Guitar, - Chime, - Xylophone, - IronXylophone, - CowBell, - Didgeridoo, - Bit, - Banjo, - Pling, - Zombie, - Skeleton, - Creeper, - Dragon, - WitherSkeleton, - Piglin, - CustomHead, + Harp = "harp", + Basedrum = "basedrum", + Snare = "snare", + Hat = "hat", + Bass = "bass", + Flute = "flute", + Bell = "bell", + Guitar = "guitar", + Chime = "chime", + Xylophone = "xylophone", + IronXylophone = "iron_xylophone", + CowBell = "cow_bell", + Didgeridoo = "didgeridoo", + Bit = "bit", + Banjo = "banjo", + Pling = "pling", + Zombie = "zombie", + Skeleton = "skeleton", + Creeper = "creeper", + Dragon = "dragon", + WitherSkeleton = "wither_skeleton", + Piglin = "piglin", + CustomHead = "custom_head", }, "note" => NoteBlockNote { - _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, + _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", + _16 = "16", + _17 = "17", + _18 = "18", + _19 = "19", + _20 = "20", + _21 = "21", + _22 = "22", + _23 = "23", + _24 = "24", }, "powered" => Powered(bool), "facing" => FacingCardinal { - North, - South, - West, - East, + North = "north", + South = "south", + West = "west", + East = "east", }, "occupied" => Occupied(bool), "part" => Part { - Head, - Foot, + Head = "head", + Foot = "foot", }, "shape" => RailShape { - NorthSouth, - EastWest, - AscendingEast, - AscendingWest, - AscendingNorth, - AscendingSouth, + NorthSouth = "north_south", + EastWest = "east_west", + AscendingEast = "ascending_east", + AscendingWest = "ascending_west", + AscendingNorth = "ascending_north", + AscendingSouth = "ascending_south", }, "extended" => Extended(bool), "half" => Half { - Upper, - Lower, + Upper = "upper", + Lower = "lower", }, "type" => PistonType { - Normal, - Sticky, + Normal = "normal", + Sticky = "sticky", }, "short" => Short(bool), "unstable" => Unstable(bool), @@ -309,22 +309,22 @@ make_block_states! { "slot_4_occupied" => Slot4Occupied(bool), "slot_5_occupied" => Slot5Occupied(bool), "age" => FireAge { - _0, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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", }, "east" => East(bool), "north" => North(bool), @@ -332,1687 +332,1687 @@ make_block_states! { "up" => Up(bool), "west" => West(bool), "creaking_heart_state" => CreakingHeartState { - Uprooted, - Dormant, - Awake, + Uprooted = "uprooted", + Dormant = "dormant", + Awake = "awake", }, "natural" => Natural(bool), "half" => TopBottom { - Top, - Bottom, + Top = "top", + Bottom = "bottom", }, "shape" => StairShape { - Straight, - InnerLeft, - InnerRight, - OuterLeft, - OuterRight, + Straight = "straight", + InnerLeft = "inner_left", + InnerRight = "inner_right", + OuterLeft = "outer_left", + OuterRight = "outer_right", }, "type" => ChestType { - Single, - Left, - Right, + Single = "single", + Left = "left", + Right = "right", }, "east" => WireEast { - Up, - Side, - None, + Up = "up", + Side = "side", + None = "none", }, "north" => WireNorth { - Up, - Side, - None, + Up = "up", + Side = "side", + None = "none", }, "power" => RedstoneWirePower { - _0, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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", }, "south" => WireSouth { - Up, - Side, - None, + Up = "up", + Side = "side", + None = "none", }, "west" => WireWest { - Up, - Side, - None, + Up = "up", + Side = "side", + None = "none", }, "age" => WheatAge { - _0, - _1, - _2, - _3, - _4, - _5, - _6, - _7, + _0 = "0", + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", + _5 = "5", + _6 = "6", + _7 = "7", }, "moisture" => FarmlandMoisture { - _0, - _1, - _2, - _3, - _4, - _5, - _6, - _7, + _0 = "0", + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", + _5 = "5", + _6 = "6", + _7 = "7", }, "lit" => Lit(bool), "rotation" => OakSignRotation { - _0, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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" => SpruceSignRotation { - _0, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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" => BirchSignRotation { - _0, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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" => AcaciaSignRotation { - _0, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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" => CherrySignRotation { - _0, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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" => JungleSignRotation { - _0, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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" => DarkOakSignRotation { - _0, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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" => PaleOakSignRotation { - _0, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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" => MangroveSignRotation { - _0, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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" => BambooSignRotation { - _0, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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", }, "hinge" => Hinge { - Left, - Right, + Left = "left", + Right = "right", }, "open" => Open(bool), "shape" => Shape { - NorthSouth, - EastWest, - AscendingEast, - AscendingWest, - AscendingNorth, - AscendingSouth, - SouthEast, - SouthWest, - NorthWest, - NorthEast, + 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), "rotation" => OakHangingSignRotation { - _0, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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" => SpruceHangingSignRotation { - _0, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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 { - _0, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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 { - _0, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - Wall, - Ceiling, + Floor = "floor", + Wall = "wall", + Ceiling = "ceiling", }, "layers" => SnowLayers { - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", + _5 = "5", + _6 = "6", + _7 = "7", + _8 = "8", }, "age" => CactusAge { - _0, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - Z, + X = "x", + Z = "z", }, "bites" => CakeBites { - _0, - _1, - _2, - _3, - _4, - _5, - _6, + _0 = "0", + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", + _5 = "5", + _6 = "6", }, "delay" => RepeaterDelay { - _1, - _2, - _3, - _4, + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", }, "locked" => Locked(bool), "down" => Down(bool), "age" => PumpkinStemAge { - _0, - _1, - _2, - _3, - _4, - _5, - _6, - _7, + _0 = "0", + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", + _5 = "5", + _6 = "6", + _7 = "7", }, "age" => MelonStemAge { - _0, - _1, - _2, - _3, - _4, - _5, - _6, - _7, + _0 = "0", + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", + _5 = "5", + _6 = "6", + _7 = "7", }, "in_wall" => InWall(bool), "type" => Type { - Top, - Bottom, - Double, + Top = "top", + Bottom = "bottom", + Double = "double", }, "east" => WallEast { - None, - Low, - Tall, + None = "none", + Low = "low", + Tall = "tall", }, "north" => WallNorth { - None, - Low, - Tall, + None = "none", + Low = "low", + Tall = "tall", }, "south" => WallSouth { - None, - Low, - Tall, + None = "none", + Low = "low", + Tall = "tall", }, "west" => WallWest { - None, - Low, - Tall, + None = "none", + Low = "low", + Tall = "tall", }, "age" => NetherWartAge { - _0, - _1, - _2, - _3, + _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, - _2, - _3, + _1 = "1", + _2 = "2", + _3 = "3", }, "level" => PowderSnowCauldronLevel { - _1, - _2, - _3, + _1 = "1", + _2 = "2", + _3 = "3", }, "eye" => Eye(bool), "age" => CocoaAge { - _0, - _1, - _2, + _0 = "0", + _1 = "1", + _2 = "2", }, "disarmed" => Disarmed(bool), "conditional" => Conditional(bool), "age" => CarrotsAge { - _0, - _1, - _2, - _3, - _4, - _5, - _6, - _7, + _0 = "0", + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", + _5 = "5", + _6 = "6", + _7 = "7", }, "age" => PotatoesAge { - _0, - _1, - _2, - _3, - _4, - _5, - _6, - _7, + _0 = "0", + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", + _5 = "5", + _6 = "6", + _7 = "7", }, "rotation" => SkeletonSkullRotation { - _0, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - Subtract, + Compare = "compare", + Subtract = "subtract", }, "inverted" => Inverted(bool), "power" => DaylightDetectorPower { - _0, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - North, - South, - West, - East, + Down = "down", + North = "north", + South = "south", + West = "west", + East = "east", }, "level" => LightLevel { - _0, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - _1, - _2, - _3, - _4, - _5, + _0 = "0", + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", + _5 = "5", }, "age" => TorchflowerCropAge { - _0, - _1, + _0 = "0", + _1 = "1", }, "age" => PitcherCropAge { - _0, - _1, - _2, - _3, - _4, + _0 = "0", + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", }, "age" => BeetrootsAge { - _0, - _1, - _2, - _3, + _0 = "0", + _1 = "1", + _2 = "2", + _3 = "3", }, "age" => FrostedIceAge { - _0, - _1, - _2, - _3, + _0 = "0", + _1 = "1", + _2 = "2", + _3 = "3", }, "age" => 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, + _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", + _16 = "16", + _17 = "17", + _18 = "18", + _19 = "19", + _20 = "20", + _21 = "21", + _22 = "22", + _23 = "23", + _24 = "24", + _25 = "25", }, "eggs" => TurtleEggEggs { - _1, - _2, - _3, - _4, + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", }, "hatch" => TurtleEggHatch { - _0, - _1, - _2, + _0 = "0", + _1 = "1", + _2 = "2", }, "hatch" => SnifferEggHatch { - _0, - _1, - _2, + _0 = "0", + _1 = "1", + _2 = "2", }, "hydration" => DriedGhastHydration { - _0, - _1, - _2, - _3, + _0 = "0", + _1 = "1", + _2 = "2", + _3 = "3", }, "pickles" => SeaPicklePickles { - _1, - _2, - _3, - _4, + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", }, "age" => BambooAge { - _0, - _1, + _0 = "0", + _1 = "1", }, "leaves" => Leaves { - None, - Small, - Large, + None = "none", + Small = "small", + Large = "large", }, "stage" => BambooStage { - _0, - _1, + _0 = "0", + _1 = "1", }, "drag" => Drag(bool), "bottom" => Bottom(bool), "distance" => ScaffoldingDistance { - _0, - _1, - _2, - _3, - _4, - _5, - _6, - _7, + _0 = "0", + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", + _5 = "5", + _6 = "6", + _7 = "7", }, "has_book" => HasBook(bool), "attachment" => Attachment { - Floor, - Ceiling, - SingleWall, - DoubleWall, + Floor = "floor", + Ceiling = "ceiling", + SingleWall = "single_wall", + DoubleWall = "double_wall", }, "signal_fire" => SignalFire(bool), "age" => SweetBerryBushAge { - _0, - _1, - _2, - _3, + _0 = "0", + _1 = "1", + _2 = "2", + _3 = "3", }, "age" => 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, + _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", + _16 = "16", + _17 = "17", + _18 = "18", + _19 = "19", + _20 = "20", + _21 = "21", + _22 = "22", + _23 = "23", + _24 = "24", + _25 = "25", }, "age" => 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, + _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", + _16 = "16", + _17 = "17", + _18 = "18", + _19 = "19", + _20 = "20", + _21 = "21", + _22 = "22", + _23 = "23", + _24 = "24", + _25 = "25", }, "rotation" => CrimsonSignRotation { - _0, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - Load, - Corner, - Data, + Save = "save", + Load = "load", + Corner = "corner", + Data = "data", }, "orientation" => Orientation { - DownEast, - DownNorth, - DownSouth, - DownWest, - UpEast, - UpNorth, - UpSouth, - UpWest, - WestUp, - EastUp, - NorthUp, - SouthUp, + DownEast = "down_east", + DownNorth = "down_north", + DownSouth = "down_south", + DownWest = "down_west", + UpEast = "up_east", + UpNorth = "up_north", + UpSouth = "up_south", + UpWest = "up_west", + WestUp = "west_up", + EastUp = "east_up", + NorthUp = "north_up", + SouthUp = "south_up", }, "mode" => TestMode { - Start, - Log, - Fail, - Accept, + Start = "start", + Log = "log", + Fail = "fail", + Accept = "accept", }, "level" => ComposterLevel { - _0, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, + _0 = "0", + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", + _5 = "5", + _6 = "6", + _7 = "7", + _8 = "8", }, "power" => TargetPower { - _0, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - _1, - _2, - _3, - _4, - _5, + _0 = "0", + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", + _5 = "5", }, "honey_level" => BeehiveHoneyLevel { - _0, - _1, - _2, - _3, - _4, - _5, + _0 = "0", + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", + _5 = "5", }, "charges" => RespawnAnchorCharges { - _0, - _1, - _2, - _3, - _4, + _0 = "0", + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", }, "candles" => CandleCandles { - _1, - _2, - _3, - _4, + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", }, "candles" => WhiteCandleCandles { - _1, - _2, - _3, - _4, + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", }, "candles" => OrangeCandleCandles { - _1, - _2, - _3, - _4, + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", }, "candles" => MagentaCandleCandles { - _1, - _2, - _3, - _4, + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", }, "candles" => LightBlueCandleCandles { - _1, - _2, - _3, - _4, + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", }, "candles" => YellowCandleCandles { - _1, - _2, - _3, - _4, + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", }, "candles" => LimeCandleCandles { - _1, - _2, - _3, - _4, + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", }, "candles" => PinkCandleCandles { - _1, - _2, - _3, - _4, + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", }, "candles" => GrayCandleCandles { - _1, - _2, - _3, - _4, + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", }, "candles" => LightGrayCandleCandles { - _1, - _2, - _3, - _4, + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", }, "candles" => CyanCandleCandles { - _1, - _2, - _3, - _4, + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", }, "candles" => PurpleCandleCandles { - _1, - _2, - _3, - _4, + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", }, "candles" => BlueCandleCandles { - _1, - _2, - _3, - _4, + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", }, "candles" => BrownCandleCandles { - _1, - _2, - _3, - _4, + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", }, "candles" => GreenCandleCandles { - _1, - _2, - _3, - _4, + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", }, "candles" => RedCandleCandles { - _1, - _2, - _3, - _4, + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", }, "candles" => BlackCandleCandles { - _1, - _2, - _3, - _4, + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", }, "power" => SculkSensorPower { - _0, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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, - Active, - Cooldown, + Inactive = "inactive", + Active = "active", + Cooldown = "cooldown", }, "power" => CalibratedSculkSensorPower { - _0, - _1, - _2, - _3, - _4, - _5, - _6, - _7, - _8, - _9, - _10, - _11, - _12, - _13, - _14, - _15, + _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), "thickness" => Thickness { - TipMerge, - Tip, - Frustum, - Middle, - Base, + TipMerge = "tip_merge", + Tip = "tip", + Frustum = "frustum", + Middle = "middle", + Base = "base", }, "vertical_direction" => VerticalDirection { - Up, - Down, + Up = "up", + Down = "down", }, "age" => CaveVinesAge { - _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, + _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", + _16 = "16", + _17 = "17", + _18 = "18", + _19 = "19", + _20 = "20", + _21 = "21", + _22 = "22", + _23 = "23", + _24 = "24", + _25 = "25", }, "berries" => Berries(bool), "flower_amount" => PinkPetalsFlowerAmount { - _1, - _2, - _3, - _4, + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", }, "flower_amount" => WildflowersFlowerAmount { - _1, - _2, - _3, - _4, + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", }, "segment_amount" => LeafLitterSegmentAmount { - _1, - _2, - _3, - _4, + _1 = "1", + _2 = "2", + _3 = "3", + _4 = "4", }, "tilt" => Tilt { - None, - Unstable, - Partial, - Full, + None = "none", + Unstable = "unstable", + Partial = "partial", + Full = "full", }, "cracked" => Cracked(bool), "crafting" => Crafting(bool), "ominous" => Ominous(bool), "trial_spawner_state" => TrialSpawnerState { - Inactive, - WaitingForPlayers, - Active, - WaitingForRewardEjection, - EjectingReward, - Cooldown, + Inactive = "inactive", + WaitingForPlayers = "waiting_for_players", + Active = "active", + WaitingForRewardEjection = "waiting_for_reward_ejection", + EjectingReward = "ejecting_reward", + Cooldown = "cooldown", }, "vault_state" => VaultState { - Inactive, - Active, - Unlocking, - Ejecting, + Inactive = "inactive", + Active = "active", + Unlocking = "unlocking", + Ejecting = "ejecting", }, "tip" => Tip(bool), }, diff --git a/azalea-block/src/lib.rs b/azalea-block/src/lib.rs index ead63bef..aa6d5dba 100644 --- a/azalea-block/src/lib.rs +++ b/azalea-block/src/lib.rs @@ -7,7 +7,7 @@ mod generated; mod range; use core::fmt::Debug; -use std::any::Any; +use std::{any::Any, collections::HashMap}; pub use behavior::BlockBehavior; // re-exported for convenience @@ -17,16 +17,34 @@ pub use range::BlockStates; pub trait BlockTrait: Debug + Any { fn behavior(&self) -> BlockBehavior; - /// Get the Minecraft ID for this block. For example `stone` or - /// `grass_block`. + /// Get the Minecraft string ID for this block. + /// + /// For example, `stone` or `grass_block`. fn id(&self) -> &'static str; - /// Convert the block to a block state. This is lossless, as the block - /// contains all the state data. + /// Convert the block to a block state. + /// + /// This is a lossless conversion, as [`BlockState`] also contains state + /// data. fn as_block_state(&self) -> BlockState; - /// Convert the block to an [`azalea_registry::Block`]. This is lossy, as - /// `azalea_registry::Block` doesn't contain any state data. + /// Convert the block to an [`azalea_registry::Block`]. + /// + /// This is a lossy conversion, as [`azalea_registry::Block`] doesn't + /// contain any state data. fn as_registry_block(&self) -> azalea_registry::Block; + + /// Returns a map of property names on this block to their values as + /// strings. + /// + /// Consider using [`Self::get_property`] if you only need a single + /// property. + fn property_map(&self) -> HashMap<&'static str, &'static str>; + /// Get a property's value as a string by its name, or `None` if the block + /// has no property with that name. + /// + /// To get all properties, you may use [`Self::property_map`]. + fn get_property(&self, name: &str) -> Option<&'static str>; } + impl dyn BlockTrait { pub fn downcast_ref<T: BlockTrait>(&self) -> Option<&T> { (self as &dyn Any).downcast_ref::<T>() @@ -37,6 +55,9 @@ pub trait Property { type Value; fn try_from_block_state(state: BlockState) -> Option<Self::Value>; + + /// Convert the value of the property to a string, like "x" or "true". + fn to_static_str(&self) -> &'static str; } #[cfg(test)] @@ -60,4 +81,51 @@ mod tests { .clone(); assert_eq!(block, block_from_state); } + + #[test] + pub fn test_property_map() { + let block = crate::blocks::OakTrapdoor { + facing: crate::properties::FacingCardinal::East, + half: crate::properties::TopBottom::Bottom, + open: true, + powered: false, + waterlogged: false, + }; + + let property_map = block.property_map(); + + assert_eq!(property_map.len(), 5); + assert_eq!(property_map.get("facing"), Some(&"east")); + assert_eq!(property_map.get("half"), Some(&"bottom")); + assert_eq!(property_map.get("open"), Some(&"true")); + assert_eq!(property_map.get("powered"), Some(&"false")); + assert_eq!(property_map.get("waterlogged"), Some(&"false")); + } + + #[test] + pub fn test_integer_properties() { + // Test with oak sapling that has an integer-like stage property + let sapling_stage_0 = crate::blocks::OakSapling { + stage: crate::properties::OakSaplingStage::_0, + }; + + let sapling_stage_1 = crate::blocks::OakSapling { + stage: crate::properties::OakSaplingStage::_1, + }; + + // Test stage 0 + let properties_0 = sapling_stage_0.property_map(); + assert_eq!(properties_0.len(), 1); + assert_eq!(properties_0.get("stage"), Some(&"0")); + assert_eq!(sapling_stage_0.get_property("stage"), Some("0")); + + // Test stage 1 + let properties_1 = sapling_stage_1.property_map(); + assert_eq!(properties_1.len(), 1); + assert_eq!(properties_1.get("stage"), Some(&"1")); + assert_eq!(sapling_stage_1.get_property("stage"), Some("1")); + + // Test non-existent property + assert_eq!(sapling_stage_0.get_property("nonexistent"), None); + } } |
