diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2024-11-27 19:31:40 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-27 19:31:40 -0600 |
| commit | 08958c2278b15ebeac8a964f392ebb792e479b61 (patch) | |
| tree | 4ae3664cea38d7fd1a8f1e95ed06fac04ffe519e /azalea-block | |
| parent | 139d77d3c2b0922fba5e9d4fa2bd9819d78bd773 (diff) | |
| download | azalea-drasl-08958c2278b15ebeac8a964f392ebb792e479b61.tar.xz | |
Refactor azalea-protocol (#190)
* start updating to 1.21.4
* fix block codegen and stop using block data from burger
* rename packet related modules and structs to be simpler
* ItemSlot -> ItemStack for more consistency with mojmap
* .get() -> .into_packet()
* simplify declare_state_packets by removing packet ids
* rename read_from and write_into to azalea_read and azalea_write
* rename McBufReadable and McBufWritable to AzaleaRead and AzaleaWrite
* McBuf -> AzBuf
* remove most uses of into_variant
* update codegen and use resourcelocation names for packets
* implement #[limit(i)] attribute for AzBuf derive macro
* fixes for 1.21.4
* fix examples
* update some physics code and fix ChatType
* remove unused imports in codegen
* re-add some things to migrate.py and update +mc version numbers automatically
* downgrade to 1.21.3 lol
Diffstat (limited to 'azalea-block')
| -rw-r--r-- | azalea-block/Cargo.toml | 2 | ||||
| -rwxr-xr-x | azalea-block/README.md | 8 | ||||
| -rw-r--r-- | azalea-block/azalea-block-macros/Cargo.toml | 2 | ||||
| -rwxr-xr-x | azalea-block/src/generated.rs | 430 | ||||
| -rwxr-xr-x | azalea-block/src/lib.rs | 14 |
5 files changed, 303 insertions, 153 deletions
diff --git a/azalea-block/Cargo.toml b/azalea-block/Cargo.toml index dc0bc199..87e3a726 100644 --- a/azalea-block/Cargo.toml +++ b/azalea-block/Cargo.toml @@ -4,7 +4,7 @@ edition = "2021" license = "MIT" name = "azalea-block" repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-block" -version = "0.10.3+mc1.21.1" +version = "0.10.3+mc1.21.3" [lib] diff --git a/azalea-block/README.md b/azalea-block/README.md index 9be4c79b..ae3b8c5f 100755 --- a/azalea-block/README.md +++ b/azalea-block/README.md @@ -9,10 +9,10 @@ There's three block types, used for different things. You can (mostly) convert b ``` # use azalea_block::BlockState; let block_state: BlockState = azalea_block::blocks::CobblestoneWall { - east: azalea_block::properties::EastWall::Low, - north: azalea_block::properties::NorthWall::Low, - south: azalea_block::properties::SouthWall::Low, - west: azalea_block::properties::WestWall::Low, + east: azalea_block::properties::WallEast::Low, + north: azalea_block::properties::WallNorth::Low, + south: azalea_block::properties::WallSouth::Low, + west: azalea_block::properties::WallWest::Low, up: false, waterlogged: false, } diff --git a/azalea-block/azalea-block-macros/Cargo.toml b/azalea-block/azalea-block-macros/Cargo.toml index 8e3885c1..70adb167 100644 --- a/azalea-block/azalea-block-macros/Cargo.toml +++ b/azalea-block/azalea-block-macros/Cargo.toml @@ -4,7 +4,7 @@ edition = "2021" license = "MIT" name = "azalea-block-macros" repository = "https://github.com/azalea-rs/azalea/tree/main/azalea-block/azalea-block-macros" -version = "0.10.3+mc1.21.1" +version = "0.10.3+mc1.21.3" [lib] proc-macro = true diff --git a/azalea-block/src/generated.rs b/azalea-block/src/generated.rs index 18ee93fc..00f1299f 100755 --- a/azalea-block/src/generated.rs +++ b/azalea-block/src/generated.rs @@ -7,6 +7,11 @@ use crate::{Block, BlockBehavior, BlockState, BlockStates, Property}; make_block_states! { Properties => { "snowy" => Snowy(bool), + "axis" => Axis { + X, + Y, + Z, + }, "stage" => OakSaplingStage { _0, _1, @@ -35,6 +40,10 @@ make_block_states! { _0, _1, }, + "stage" => PaleOakSaplingStage { + _0, + _1, + }, "age" => MangrovePropaguleAge { _0, _1, @@ -96,11 +105,6 @@ make_block_states! { _2, _3, }, - "axis" => Axis { - X, - Y, - Z, - }, "distance" => OakLeavesDistance { _1, _2, @@ -165,6 +169,15 @@ make_block_states! { _6, _7, }, + "distance" => PaleOakLeavesDistance { + _1, + _2, + _3, + _4, + _5, + _6, + _7, + }, "distance" => MangroveLeavesDistance { _1, _2, @@ -284,7 +297,12 @@ make_block_states! { }, "short" => Short(bool), "unstable" => Unstable(bool), - "slot_5_occupied" => TrueFalse(bool), + "slot_0_occupied" => Slot0Occupied(bool), + "slot_1_occupied" => Slot1Occupied(bool), + "slot_2_occupied" => Slot2Occupied(bool), + "slot_3_occupied" => Slot3Occupied(bool), + "slot_4_occupied" => Slot4Occupied(bool), + "slot_5_occupied" => Slot5Occupied(bool), "age" => FireAge { _0, _1, @@ -308,6 +326,11 @@ make_block_states! { "south" => South(bool), "up" => Up(bool), "west" => West(bool), + "creaking" => Creaking { + Disabled, + Dormant, + Active, + }, "half" => TopBottom { Top, Bottom, @@ -509,6 +532,24 @@ make_block_states! { _14, _15, }, + "rotation" => PaleOakSignRotation { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, "rotation" => MangroveSignRotation { _0, _1, @@ -689,6 +730,24 @@ make_block_states! { _14, _15, }, + "rotation" => PaleOakHangingSignRotation { + _0, + _1, + _2, + _3, + _4, + _5, + _6, + _7, + _8, + _9, + _10, + _11, + _12, + _13, + _14, + _15, + }, "rotation" => CrimsonHangingSignRotation { _0, _1, @@ -882,22 +941,22 @@ make_block_states! { }, "disarmed" => Disarmed(bool), "conditional" => Conditional(bool), - "east" => EastWall { + "east" => WallEast { None, Low, Tall, }, - "north" => NorthWall { + "north" => WallNorth { None, Low, Tall, }, - "south" => SouthWall { + "south" => WallSouth { None, Low, Tall, }, - "west" => WestWall { + "west" => WallWest { None, Low, Tall, @@ -1438,17 +1497,13 @@ make_block_states! { _0, _1, }, - "age" => _0_1_2_3_4 { + "age" => PitcherCropAge { _0, _1, _2, _3, _4, }, - "half" => UpperLower { - Upper, - Lower, - }, "age" => BeetrootsAge { _0, _1, @@ -1673,7 +1728,7 @@ make_block_states! { _7, _8, }, - "power" => TargetOutputPower { + "power" => TargetPower { _0, _1, _2, @@ -1707,7 +1762,7 @@ make_block_states! { _4, _5, }, - "charges" => RespawnAnchorCharge { + "charges" => RespawnAnchorCharges { _0, _1, _2, @@ -1834,7 +1889,7 @@ make_block_states! { _14, _15, }, - "sculk_sensor_phase" => Phase { + "sculk_sensor_phase" => SculkSensorPhase { Inactive, Active, Cooldown, @@ -1867,7 +1922,7 @@ make_block_states! { Middle, Base, }, - "vertical_direction" => TipDirection { + "vertical_direction" => VerticalDirection { Up, Down, }, @@ -1900,7 +1955,7 @@ make_block_states! { _25, }, "berries" => Berries(bool), - "flower_amount" => PinkPetalsAmount { + "flower_amount" => PinkPetalsFlowerAmount { _1, _2, _3, @@ -1912,11 +1967,6 @@ make_block_states! { Partial, Full, }, - "axis" => Falling { - X, - Y, - Z, - }, "cracked" => Cracked(bool), "crafting" => Crafting(bool), "ominous" => Ominous(bool), @@ -1934,6 +1984,7 @@ make_block_states! { Unlocking, Ejecting, }, + "tip" => Tip(bool), }, Blocks => { air => BlockBehavior::new(), {}, @@ -1960,6 +2011,10 @@ make_block_states! { acacia_planks => BlockBehavior::new().strength(2.0, 3.0), {}, cherry_planks => BlockBehavior::new().strength(2.0, 3.0), {}, dark_oak_planks => BlockBehavior::new().strength(2.0, 3.0), {}, + pale_oak_wood => BlockBehavior::new(), { + "axis": Axis::Y, + }, + pale_oak_planks => BlockBehavior::new(), {}, mangrove_planks => BlockBehavior::new().strength(2.0, 3.0), {}, bamboo_planks => BlockBehavior::new().strength(2.0, 3.0), {}, bamboo_mosaic => BlockBehavior::new().strength(2.0, 3.0), {}, @@ -1984,6 +2039,9 @@ make_block_states! { dark_oak_sapling => BlockBehavior::new(), { "stage": DarkOakSaplingStage::_0, }, + pale_oak_sapling => BlockBehavior::new(), { + "stage": PaleOakSaplingStage::_0, + }, mangrove_propagule => BlockBehavior::new(), { "age": MangrovePropaguleAge::_0, "hanging": Hanging(false), @@ -2034,6 +2092,9 @@ make_block_states! { dark_oak_log => BlockBehavior::new().strength(2.0, 2.0), { "axis": Axis::Y, }, + pale_oak_log => BlockBehavior::new(), { + "axis": Axis::Y, + }, mangrove_log => BlockBehavior::new().strength(2.0, 2.0), { "axis": Axis::Y, }, @@ -2064,6 +2125,9 @@ make_block_states! { stripped_dark_oak_log => BlockBehavior::new().strength(2.0, 2.0), { "axis": Axis::Y, }, + stripped_pale_oak_log => BlockBehavior::new(), { + "axis": Axis::Y, + }, stripped_oak_log => BlockBehavior::new().strength(2.0, 2.0), { "axis": Axis::Y, }, @@ -2118,6 +2182,9 @@ make_block_states! { stripped_dark_oak_wood => BlockBehavior::new().strength(2.0, 2.0), { "axis": Axis::Y, }, + stripped_pale_oak_wood => BlockBehavior::new(), { + "axis": Axis::Y, + }, stripped_mangrove_wood => BlockBehavior::new().strength(2.0, 2.0), { "axis": Axis::Y, }, @@ -2156,6 +2223,11 @@ make_block_states! { "persistent": Persistent(false), "waterlogged": Waterlogged(false), }, + pale_oak_leaves => BlockBehavior::new(), { + "distance": PaleOakLeavesDistance::_7, + "persistent": Persistent(false), + "waterlogged": Waterlogged(false), + }, mangrove_leaves => BlockBehavior::new().strength(0.2, 0.2), { "distance": MangroveLeavesDistance::_7, "persistent": Persistent(false), @@ -2345,12 +2417,12 @@ make_block_states! { bookshelf => BlockBehavior::new().strength(1.5, 1.5), {}, chiseled_bookshelf => BlockBehavior::new().strength(1.5, 1.5), { "facing": FacingCardinal::North, - "slot_0_occupied": TrueFalse(false), - "slot_1_occupied": TrueFalse(false), - "slot_2_occupied": TrueFalse(false), - "slot_3_occupied": TrueFalse(false), - "slot_4_occupied": TrueFalse(false), - "slot_5_occupied": TrueFalse(false), + "slot_0_occupied": Slot0Occupied(false), + "slot_1_occupied": Slot1Occupied(false), + "slot_2_occupied": Slot2Occupied(false), + "slot_3_occupied": Slot3Occupied(false), + "slot_4_occupied": Slot4Occupied(false), + "slot_5_occupied": Slot5Occupied(false), }, mossy_cobblestone => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), {}, obsidian => BlockBehavior::new().requires_correct_tool_for_drops().strength(50.0, 1200.0), {}, @@ -2368,6 +2440,10 @@ make_block_states! { }, soul_fire => BlockBehavior::new(), {}, spawner => BlockBehavior::new().requires_correct_tool_for_drops().strength(5.0, 5.0), {}, + creaking_heart => BlockBehavior::new(), { + "axis": Axis::Y, + "creaking": Creaking::Disabled, + }, oak_stairs => BlockBehavior::new().strength(2.0, 3.0), { "facing": FacingCardinal::North, "half": TopBottom::Bottom, @@ -2428,6 +2504,10 @@ make_block_states! { "rotation": DarkOakSignRotation::_0, "waterlogged": Waterlogged(false), }, + pale_oak_sign => BlockBehavior::new(), { + "rotation": PaleOakSignRotation::_0, + "waterlogged": Waterlogged(false), + }, mangrove_sign => BlockBehavior::new().strength(1.0, 1.0), { "rotation": MangroveSignRotation::_0, "waterlogged": Waterlogged(false), @@ -2485,6 +2565,10 @@ make_block_states! { "facing": FacingCardinal::North, "waterlogged": Waterlogged(false), }, + pale_oak_wall_sign => BlockBehavior::new(), { + "facing": FacingCardinal::North, + "waterlogged": Waterlogged(false), + }, mangrove_wall_sign => BlockBehavior::new().strength(1.0, 1.0), { "facing": FacingCardinal::North, "waterlogged": Waterlogged(false), @@ -2528,6 +2612,11 @@ make_block_states! { "rotation": DarkOakHangingSignRotation::_0, "waterlogged": Waterlogged(false), }, + pale_oak_hanging_sign => BlockBehavior::new(), { + "attached": Attached(false), + "rotation": PaleOakHangingSignRotation::_0, + "waterlogged": Waterlogged(false), + }, crimson_hanging_sign => BlockBehavior::new().strength(1.0, 1.0), { "attached": Attached(false), "rotation": CrimsonHangingSignRotation::_0, @@ -2576,6 +2665,10 @@ make_block_states! { "facing": FacingCardinal::North, "waterlogged": Waterlogged(false), }, + pale_oak_wall_hanging_sign => BlockBehavior::new(), { + "facing": FacingCardinal::North, + "waterlogged": Waterlogged(false), + }, mangrove_wall_hanging_sign => BlockBehavior::new().strength(1.0, 1.0), { "facing": FacingCardinal::North, "waterlogged": Waterlogged(false), @@ -2628,6 +2721,9 @@ make_block_states! { dark_oak_pressure_plate => BlockBehavior::new().strength(0.5, 0.5), { "powered": Powered(false), }, + pale_oak_pressure_plate => BlockBehavior::new(), { + "powered": Powered(false), + }, mangrove_pressure_plate => BlockBehavior::new().strength(0.5, 0.5), { "powered": Powered(false), }, @@ -2771,6 +2867,13 @@ make_block_states! { "powered": Powered(false), "waterlogged": Waterlogged(false), }, + pale_oak_trapdoor => BlockBehavior::new(), { + "facing": FacingCardinal::North, + "half": TopBottom::Bottom, + "open": Open(false), + "powered": Powered(false), + "waterlogged": Waterlogged(false), + }, mangrove_trapdoor => BlockBehavior::new().strength(3.0, 3.0), { "facing": FacingCardinal::North, "half": TopBottom::Bottom, @@ -2993,20 +3096,20 @@ make_block_states! { }, beacon => BlockBehavior::new().strength(3.0, 3.0), {}, cobblestone_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), { - "east": EastWall::None, - "north": NorthWall::None, - "south": SouthWall::None, + "east": WallEast::None, + "north": WallNorth::None, + "south": WallSouth::None, "up": Up(true), "waterlogged": Waterlogged(false), - "west": WestWall::None, + "west": WallWest::None, }, mossy_cobblestone_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), { - "east": EastWall::None, - "north": NorthWall::None, - "south": SouthWall::None, + "east": WallEast::None, + "north": WallNorth::None, + "south": WallSouth::None, "up": Up(true), "waterlogged": Waterlogged(false), - "west": WestWall::None, + "west": WallWest::None, }, flower_pot => BlockBehavior::new(), {}, potted_torchflower => BlockBehavior::new(), {}, @@ -3017,6 +3120,7 @@ make_block_states! { potted_acacia_sapling => BlockBehavior::new(), {}, potted_cherry_sapling => BlockBehavior::new(), {}, potted_dark_oak_sapling => BlockBehavior::new(), {}, + potted_pale_oak_sapling => BlockBehavior::new(), {}, potted_mangrove_propagule => BlockBehavior::new(), {}, potted_fern => BlockBehavior::new(), {}, potted_dandelion => BlockBehavior::new(), {}, @@ -3077,6 +3181,11 @@ make_block_states! { "facing": FacingCardinal::North, "powered": Powered(false), }, + pale_oak_button => BlockBehavior::new(), { + "face": Face::Wall, + "facing": FacingCardinal::North, + "powered": Powered(false), + }, mangrove_button => BlockBehavior::new().strength(0.5, 0.5), { "face": Face::Wall, "facing": FacingCardinal::North, @@ -3344,6 +3453,12 @@ make_block_states! { "shape": StairShape::Straight, "waterlogged": Waterlogged(false), }, + pale_oak_stairs => BlockBehavior::new(), { + "facing": FacingCardinal::North, + "half": TopBottom::Bottom, + "shape": StairShape::Straight, + "waterlogged": Waterlogged(false), + }, mangrove_stairs => BlockBehavior::new().strength(2.0, 3.0), { "facing": FacingCardinal::North, "half": TopBottom::Bottom, @@ -3584,6 +3699,10 @@ make_block_states! { "type": Type::Bottom, "waterlogged": Waterlogged(false), }, + pale_oak_slab => BlockBehavior::new(), { + "type": Type::Bottom, + "waterlogged": Waterlogged(false), + }, mangrove_slab => BlockBehavior::new().strength(2.0, 3.0), { "type": Type::Bottom, "waterlogged": Waterlogged(false), @@ -3692,6 +3811,12 @@ make_block_states! { "open": Open(false), "powered": Powered(false), }, + pale_oak_fence_gate => BlockBehavior::new(), { + "facing": FacingCardinal::North, + "in_wall": InWall(false), + "open": Open(false), + "powered": Powered(false), + }, mangrove_fence_gate => BlockBehavior::new().strength(2.0, 3.0), { "facing": FacingCardinal::North, "in_wall": InWall(false), @@ -3746,6 +3871,13 @@ make_block_states! { "waterlogged": Waterlogged(false), "west": West(false), }, + pale_oak_fence => BlockBehavior::new(), { + "east": East(false), + "north": North(false), + "south": South(false), + "waterlogged": Waterlogged(false), + "west": West(false), + }, mangrove_fence => BlockBehavior::new().strength(2.0, 3.0), { "east": East(false), "north": North(false), @@ -3802,6 +3934,13 @@ make_block_states! { "open": Open(false), "powered": Powered(false), }, + pale_oak_door => BlockBehavior::new(), { + "facing": FacingCardinal::North, + "half": Half::Lower, + "hinge": Hinge::Left, + "open": Open(false), + "powered": Powered(false), + }, mangrove_door => BlockBehavior::new().strength(3.0, 3.0), { "facing": FacingCardinal::North, "half": Half::Lower, @@ -3845,8 +3984,8 @@ make_block_states! { "age": TorchflowerCropAge::_0, }, pitcher_crop => BlockBehavior::new(), { - "age": _0_1_2_3_4::_0, - "half": UpperLower::Lower, + "age": PitcherCropAge::_0, + "half": Half::Lower, }, pitcher_plant => BlockBehavior::new(), { "half": Half::Lower, @@ -4288,108 +4427,108 @@ make_block_states! { "waterlogged": Waterlogged(false), }, brick_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), { - "east": EastWall::None, - "north": NorthWall::None, - "south": SouthWall::None, + "east": WallEast::None, + "north": WallNorth::None, + "south": WallSouth::None, "up": Up(true), "waterlogged": Waterlogged(false), - "west": WestWall::None, + "west": WallWest::None, }, prismarine_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), { - "east": EastWall::None, - "north": NorthWall::None, - "south": SouthWall::None, + "east": WallEast::None, + "north": WallNorth::None, + "south": WallSouth::None, "up": Up(true), "waterlogged": Waterlogged(false), - "west": WestWall::None, + "west": WallWest::None, }, red_sandstone_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(0.8, 0.8), { - "east": EastWall::None, - "north": NorthWall::None, - "south": SouthWall::None, + "east": WallEast::None, + "north": WallNorth::None, + "south": WallSouth::None, "up": Up(true), "waterlogged": Waterlogged(false), - "west": WestWall::None, + "west": WallWest::None, }, mossy_stone_brick_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), { - "east": EastWall::None, - "north": NorthWall::None, - "south": SouthWall::None, + "east": WallEast::None, + "north": WallNorth::None, + "south": WallSouth::None, "up": Up(true), "waterlogged": Waterlogged(false), - "west": WestWall::None, + "west": WallWest::None, }, granite_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), { - "east": EastWall::None, - "north": NorthWall::None, - "south": SouthWall::None, + "east": WallEast::None, + "north": WallNorth::None, + "south": WallSouth::None, "up": Up(true), "waterlogged": Waterlogged(false), - "west": WestWall::None, + "west": WallWest::None, }, stone_brick_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), { - "east": EastWall::None, - "north": NorthWall::None, - "south": SouthWall::None, + "east": WallEast::None, + "north": WallNorth::None, + "south": WallSouth::None, "up": Up(true), "waterlogged": Waterlogged(false), - "west": WestWall::None, + "west": WallWest::None, }, mud_brick_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 3.0), { - "east": EastWall::None, - "north": NorthWall::None, - "south": SouthWall::None, + "east": WallEast::None, + "north": WallNorth::None, + "south": WallSouth::None, "up": Up(true), "waterlogged": Waterlogged(false), - "west": WestWall::None, + "west": WallWest::None, }, nether_brick_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), { - "east": EastWall::None, - "north": NorthWall::None, - "south": SouthWall::None, + "east": WallEast::None, + "north": WallNorth::None, + "south": WallSouth::None, "up": Up(true), "waterlogged": Waterlogged(false), - "west": WestWall::None, + "west": WallWest::None, }, andesite_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), { - "east": EastWall::None, - "north": NorthWall::None, - "south": SouthWall::None, + "east": WallEast::None, + "north": WallNorth::None, + "south": WallSouth::None, "up": Up(true), "waterlogged": Waterlogged(false), - "west": WestWall::None, + "west": WallWest::None, }, red_nether_brick_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), { - "east": EastWall::None, - "north": NorthWall::None, - "south": SouthWall::None, + "east": WallEast::None, + "north": WallNorth::None, + "south": WallSouth::None, "up": Up(true), "waterlogged": Waterlogged(false), - "west": WestWall::None, + "west": WallWest::None, }, sandstone_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(0.8, 0.8), { - "east": EastWall::None, - "north": NorthWall::None, - "south": SouthWall::None, + "east": WallEast::None, + "north": WallNorth::None, + "south": WallSouth::None, "up": Up(true), "waterlogged": Waterlogged(false), - "west": WestWall::None, + "west": WallWest::None, }, end_stone_brick_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.0, 9.0), { - "east": EastWall::None, - "north": NorthWall::None, - "south": SouthWall::None, + "east": WallEast::None, + "north": WallNorth::None, + "south": WallSouth::None, "up": Up(true), "waterlogged": Waterlogged(false), - "west": WestWall::None, + "west": WallWest::None, }, diorite_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), { - "east": EastWall::None, - "north": NorthWall::None, - "south": SouthWall::None, + "east": WallEast::None, + "north": WallNorth::None, + "south": WallSouth::None, "up": Up(true), "waterlogged": Waterlogged(false), - "west": WestWall::None, + "west": WallWest::None, }, scaffolding => BlockBehavior::new(), { "bottom": Bottom(false), @@ -4613,7 +4752,7 @@ make_block_states! { "level": ComposterLevel::_0, }, target => BlockBehavior::new().strength(0.5, 0.5), { - "power": TargetOutputPower::_0, + "power": TargetPower::_0, }, bee_nest => BlockBehavior::new().strength(0.3, 0.3), { "facing": FacingCardinal::North, @@ -4629,7 +4768,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": RespawnAnchorCharge::_0, + "charges": RespawnAnchorCharges::_0, }, potted_crimson_fungus => BlockBehavior::new(), {}, potted_warped_fungus => BlockBehavior::new(), {}, @@ -4644,12 +4783,12 @@ make_block_states! { "waterlogged": Waterlogged(false), }, blackstone_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), { - "east": EastWall::None, - "north": NorthWall::None, - "south": SouthWall::None, + "east": WallEast::None, + "north": WallNorth::None, + "south": WallSouth::None, "up": Up(true), "waterlogged": Waterlogged(false), - "west": WestWall::None, + "west": WallWest::None, }, blackstone_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), { "type": Type::Bottom, @@ -4670,12 +4809,12 @@ make_block_states! { "waterlogged": Waterlogged(false), }, polished_blackstone_brick_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), { - "east": EastWall::None, - "north": NorthWall::None, - "south": SouthWall::None, + "east": WallEast::None, + "north": WallNorth::None, + "south": WallSouth::None, "up": Up(true), "waterlogged": Waterlogged(false), - "west": WestWall::None, + "west": WallWest::None, }, gilded_blackstone => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), {}, polished_blackstone_stairs => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), { @@ -4697,12 +4836,12 @@ make_block_states! { "powered": Powered(false), }, polished_blackstone_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), { - "east": EastWall::None, - "north": NorthWall::None, - "south": SouthWall::None, + "east": WallEast::None, + "north": WallNorth::None, + "south": WallSouth::None, "up": Up(true), "waterlogged": Waterlogged(false), - "west": WestWall::None, + "west": WallWest::None, }, chiseled_nether_bricks => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), {}, cracked_nether_bricks => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), {}, @@ -4873,12 +5012,12 @@ make_block_states! { "waterlogged": Waterlogged(false), }, tuff_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), { - "east": EastWall::None, - "north": NorthWall::None, - "south": SouthWall::None, + "east": WallEast::None, + "north": WallNorth::None, + "south": WallSouth::None, "up": Up(true), "waterlogged": Waterlogged(false), - "west": WestWall::None, + "west": WallWest::None, }, polished_tuff => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), {}, polished_tuff_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), { @@ -4892,12 +5031,12 @@ make_block_states! { "waterlogged": Waterlogged(false), }, polished_tuff_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), { - "east": EastWall::None, - "north": NorthWall::None, - "south": SouthWall::None, + "east": WallEast::None, + "north": WallNorth::None, + "south": WallSouth::None, "up": Up(true), "waterlogged": Waterlogged(false), - "west": WestWall::None, + "west": WallWest::None, }, chiseled_tuff => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), {}, tuff_bricks => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), {}, @@ -4912,12 +5051,12 @@ make_block_states! { "waterlogged": Waterlogged(false), }, tuff_brick_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), { - "east": EastWall::None, - "north": NorthWall::None, - "south": SouthWall::None, + "east": WallEast::None, + "north": WallNorth::None, + "south": WallSouth::None, "up": Up(true), "waterlogged": Waterlogged(false), - "west": WestWall::None, + "west": WallWest::None, }, chiseled_tuff_bricks => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), {}, calcite => BlockBehavior::new().requires_correct_tool_for_drops().strength(0.75, 0.75), {}, @@ -4925,13 +5064,13 @@ make_block_states! { powder_snow => BlockBehavior::new().strength(0.25, 0.25), {}, sculk_sensor => BlockBehavior::new().strength(1.5, 1.5), { "power": SculkSensorPower::_0, - "sculk_sensor_phase": Phase::Inactive, + "sculk_sensor_phase": SculkSensorPhase::Inactive, "waterlogged": Waterlogged(false), }, calibrated_sculk_sensor => BlockBehavior::new().strength(1.5, 1.5), { "facing": FacingCardinal::North, "power": CalibratedSculkSensorPower::_0, - "sculk_sensor_phase": Phase::Inactive, + "sculk_sensor_phase": SculkSensorPhase::Inactive, "waterlogged": Waterlogged(false), }, sculk => BlockBehavior::new().strength(0.2, 0.2), {}, @@ -5233,7 +5372,7 @@ make_block_states! { }, pointed_dripstone => BlockBehavior::new().strength(1.5, 3.0), { "thickness": Thickness::Tip, - "vertical_direction": TipDirection::Up, + "vertical_direction": VerticalDirection::Up, "waterlogged": Waterlogged(false), }, dripstone_block => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 1.0), {}, @@ -5250,7 +5389,7 @@ make_block_states! { moss_carpet => BlockBehavior::new().strength(0.1, 0.1), {}, pink_petals => BlockBehavior::new(), { "facing": FacingCardinal::North, - "flower_amount": PinkPetalsAmount::_1, + "flower_amount": PinkPetalsFlowerAmount::_1, }, moss_block => BlockBehavior::new().strength(0.1, 0.1), {}, big_dripleaf => BlockBehavior::new().strength(0.1, 0.1), { @@ -5287,12 +5426,12 @@ make_block_states! { "waterlogged": Waterlogged(false), }, cobbled_deepslate_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.5, 6.0), { - "east": EastWall::None, - "north": NorthWall::None, - "south": SouthWall::None, + "east": WallEast::None, + "north": WallNorth::None, + "south": WallSouth::None, "up": Up(true), "waterlogged": Waterlogged(false), - "west": WestWall::None, + "west": WallWest::None, }, polished_deepslate => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.5, 6.0), {}, polished_deepslate_stairs => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.5, 6.0), { @@ -5306,12 +5445,12 @@ make_block_states! { "waterlogged": Waterlogged(false), }, polished_deepslate_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.5, 6.0), { - "east": EastWall::None, - "north": NorthWall::None, - "south": SouthWall::None, + "east": WallEast::None, + "north": WallNorth::None, + "south": WallSouth::None, "up": Up(true), "waterlogged": Waterlogged(false), - "west": WestWall::None, + "west": WallWest::None, }, deepslate_tiles => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.5, 6.0), {}, deepslate_tile_stairs => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.5, 6.0), { @@ -5325,12 +5464,12 @@ make_block_states! { "waterlogged": Waterlogged(false), }, deepslate_tile_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.5, 6.0), { - "east": EastWall::None, - "north": NorthWall::None, - "south": SouthWall::None, + "east": WallEast::None, + "north": WallNorth::None, + "south": WallSouth::None, "up": Up(true), "waterlogged": Waterlogged(false), - "west": WestWall::None, + "west": WallWest::None, }, deepslate_bricks => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.5, 6.0), {}, deepslate_brick_stairs => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.5, 6.0), { @@ -5344,18 +5483,18 @@ make_block_states! { "waterlogged": Waterlogged(false), }, deepslate_brick_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.5, 6.0), { - "east": EastWall::None, - "north": NorthWall::None, - "south": SouthWall::None, + "east": WallEast::None, + "north": WallNorth::None, + "south": WallSouth::None, "up": Up(true), "waterlogged": Waterlogged(false), - "west": WestWall::None, + "west": WallWest::None, }, chiseled_deepslate => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.5, 6.0), {}, cracked_deepslate_bricks => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.5, 6.0), {}, cracked_deepslate_tiles => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.5, 6.0), {}, infested_deepslate => BlockBehavior::new().strength(1.5, 0.75), { - "axis": Falling::Y, + "axis": Axis::Y, }, smooth_basalt => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.25, 4.2), {}, raw_iron_block => BlockBehavior::new().requires_correct_tool_for_drops().strength(5.0, 6.0), {}, @@ -5396,5 +5535,16 @@ make_block_states! { heavy_core => BlockBehavior::new(), { "waterlogged": Waterlogged(false), }, + pale_moss_block => BlockBehavior::new(), {}, + pale_moss_carpet => BlockBehavior::new(), { + "bottom": Bottom(true), + "east": WallEast::None, + "north": WallNorth::None, + "south": WallSouth::None, + "west": WallWest::None, + }, + pale_hanging_moss => BlockBehavior::new(), { + "tip": Tip(true), + }, } } diff --git a/azalea-block/src/lib.rs b/azalea-block/src/lib.rs index 7e6ccfaf..c1655919 100755 --- a/azalea-block/src/lib.rs +++ b/azalea-block/src/lib.rs @@ -11,7 +11,7 @@ use std::{ io::{Cursor, Write}, }; -use azalea_buf::{BufReadError, McBufReadable, McBufVarReadable, McBufVarWritable, McBufWritable}; +use azalea_buf::{AzaleaRead, AzaleaReadVar, AzaleaWrite, AzaleaWriteVar, BufReadError}; pub use behavior::BlockBehavior; pub use generated::{blocks, properties}; pub use range::BlockStates; @@ -80,17 +80,17 @@ impl TryFrom<u32> for BlockState { } } -impl McBufReadable for BlockState { - fn read_from(buf: &mut Cursor<&[u8]>) -> Result<Self, BufReadError> { - let state_id = u32::var_read_from(buf)?; +impl AzaleaRead for BlockState { + fn azalea_read(buf: &mut Cursor<&[u8]>) -> Result<Self, BufReadError> { + let state_id = u32::azalea_read_var(buf)?; Self::try_from(state_id).map_err(|_| BufReadError::UnexpectedEnumVariant { id: state_id as i32, }) } } -impl McBufWritable for BlockState { - fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { - u32::var_write_into(&self.id, buf) +impl AzaleaWrite for BlockState { + fn azalea_write(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { + u32::azalea_write_var(&self.id, buf) } } |
