diff options
| author | mat <git@matdoes.dev> | 2026-03-21 13:07:23 +0700 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2026-03-23 05:14:23 +1000 |
| commit | cac25feb6c43793a84396ac4a19e90df19d1f235 (patch) | |
| tree | 0e78bb4e88b1c2d91a86cc3a278c9d2c2a944f14 /azalea-block/src | |
| parent | 88606d9ce9e13fcdd4ab5ce26e52630dee614c1e (diff) | |
| download | azalea-drasl-cac25feb6c43793a84396ac4a19e90df19d1f235.tar.xz | |
cleanup and slightly speed up is_block_state_standable
Diffstat (limited to 'azalea-block/src')
| -rw-r--r-- | azalea-block/src/block_state.rs | 2 | ||||
| -rw-r--r-- | azalea-block/src/generated.rs | 158 |
2 files changed, 80 insertions, 80 deletions
diff --git a/azalea-block/src/block_state.rs b/azalea-block/src/block_state.rs index 3806c915..6e4d5e85 100644 --- a/azalea-block/src/block_state.rs +++ b/azalea-block/src/block_state.rs @@ -60,7 +60,7 @@ impl BlockState { /// This only checks for normal air, not other types like cave air. #[inline] pub fn is_air(&self) -> bool { - self == &Self::AIR + *self == Self::AIR } /// Returns the protocol ID for the block state. diff --git a/azalea-block/src/generated.rs b/azalea-block/src/generated.rs index 62b580d7..3eb1109c 100644 --- a/azalea-block/src/generated.rs +++ b/azalea-block/src/generated.rs @@ -259,7 +259,7 @@ make_block_states! { Upper = "upper", Lower = "lower", }, - "type" => PistonType { + "type" => PistonKind { Normal = "normal", Sticky = "sticky", }, @@ -317,7 +317,7 @@ make_block_states! { OuterLeft = "outer_left", OuterRight = "outer_right", }, - "type" => ChestType { + "type" => ChestKind { Single = "single", Left = "left", Right = "right", @@ -511,7 +511,7 @@ make_block_states! { _7 = "7", }, "in_wall" => InWall(bool), - "type" => Type { + "type" => SlabKind { Top = "top", Bottom = "bottom", Double = "double", @@ -583,7 +583,7 @@ make_block_states! { _6 = "6", _7 = "7", }, - "mode" => ComparatorType { + "mode" => ComparatorKind { Compare = "compare", Subtract = "subtract", }, @@ -1321,7 +1321,7 @@ make_block_states! { "facing": FacingCubic::North, }, piston_head => BlockBehavior::new().strength(1.5, 1.5), { - "type": PistonType::Normal, + "type": PistonKind::Normal, "facing": FacingCubic::North, "short": Short(false), }, @@ -1342,7 +1342,7 @@ make_block_states! { red_wool => BlockBehavior::new().strength(0.8, 0.8), {}, black_wool => BlockBehavior::new().strength(0.8, 0.8), {}, moving_piston => BlockBehavior::new().destroy_time(-1.0).force_solid(true), { - "type": PistonType::Normal, + "type": PistonKind::Normal, "facing": FacingCubic::North, }, dandelion => BlockBehavior::new(), {}, @@ -1477,7 +1477,7 @@ make_block_states! { "waterlogged": Waterlogged(false), }, chest => BlockBehavior::new().strength(2.5, 2.5), { - "type": ChestType::Single, + "type": ChestKind::Single, "facing": FacingCardinal::North, "waterlogged": Waterlogged(false), }, @@ -2137,7 +2137,7 @@ make_block_states! { "waterlogged": Waterlogged(false), }, resin_brick_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, resin_brick_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), { @@ -2411,7 +2411,7 @@ make_block_states! { "facing": FacingCardinal::North, }, trapped_chest => BlockBehavior::new().strength(2.5, 2.5), { - "type": ChestType::Single, + "type": ChestKind::Single, "facing": FacingCardinal::North, "waterlogged": Waterlogged(false), }, @@ -2423,7 +2423,7 @@ make_block_states! { }, comparator => BlockBehavior::new(), { "facing": FacingCardinal::North, - "mode": ComparatorType::Compare, + "mode": ComparatorKind::Compare, "powered": Powered(false), }, daylight_detector => BlockBehavior::new().strength(0.2, 0.2), { @@ -2663,15 +2663,15 @@ make_block_states! { "waterlogged": Waterlogged(false), }, prismarine_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, prismarine_brick_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, dark_prismarine_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, sea_lantern => BlockBehavior::new().strength(0.3, 0.3), {}, @@ -2821,103 +2821,103 @@ make_block_states! { "waterlogged": Waterlogged(false), }, oak_slab => BlockBehavior::new().strength(2.0, 3.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, spruce_slab => BlockBehavior::new().strength(2.0, 3.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, birch_slab => BlockBehavior::new().strength(2.0, 3.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, jungle_slab => BlockBehavior::new().strength(2.0, 3.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, acacia_slab => BlockBehavior::new().strength(2.0, 3.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, cherry_slab => BlockBehavior::new().strength(2.0, 3.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, dark_oak_slab => BlockBehavior::new().strength(2.0, 3.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, pale_oak_slab => BlockBehavior::new().strength(2.0, 3.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, mangrove_slab => BlockBehavior::new().strength(2.0, 3.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, bamboo_slab => BlockBehavior::new().strength(2.0, 3.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, bamboo_mosaic_slab => BlockBehavior::new().strength(2.0, 3.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, stone_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, smooth_stone_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, sandstone_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, cut_sandstone_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, petrified_oak_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, cobblestone_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, brick_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, stone_brick_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, mud_brick_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 3.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, nether_brick_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, quartz_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, red_sandstone_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, cut_red_sandstone_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, purpur_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, smooth_stone => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), {}, @@ -3529,55 +3529,55 @@ make_block_states! { "waterlogged": Waterlogged(false), }, polished_granite_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, smooth_red_sandstone_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, mossy_stone_brick_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, polished_diorite_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, mossy_cobblestone_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, end_stone_brick_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.0, 9.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, smooth_sandstone_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, smooth_quartz_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, granite_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, andesite_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, red_nether_brick_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, polished_andesite_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, diorite_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, brick_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0).force_solid(true), { @@ -3823,11 +3823,11 @@ make_block_states! { crimson_planks => BlockBehavior::new().strength(2.0, 3.0), {}, warped_planks => BlockBehavior::new().strength(2.0, 3.0), {}, crimson_slab => BlockBehavior::new().strength(2.0, 3.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, warped_slab => BlockBehavior::new().strength(2.0, 3.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, crimson_pressure_plate => BlockBehavior::new().strength(0.5, 0.5).force_solid(true), { @@ -3981,7 +3981,7 @@ make_block_states! { "west": WallWest::None, }, blackstone_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, polished_blackstone => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), {}, @@ -3989,7 +3989,7 @@ make_block_states! { cracked_polished_blackstone_bricks => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), {}, chiseled_polished_blackstone => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), {}, polished_blackstone_brick_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, polished_blackstone_brick_stairs => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), { @@ -4014,7 +4014,7 @@ make_block_states! { "waterlogged": Waterlogged(false), }, polished_blackstone_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, polished_blackstone_pressure_plate => BlockBehavior::new().strength(0.5, 0.5).force_solid(true), { @@ -4192,7 +4192,7 @@ make_block_states! { }, tuff => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), {}, tuff_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, tuff_stairs => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), { @@ -4211,7 +4211,7 @@ make_block_states! { }, 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), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, polished_tuff_stairs => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), { @@ -4231,7 +4231,7 @@ make_block_states! { 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), {}, tuff_brick_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, tuff_brick_stairs => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), { @@ -4324,19 +4324,19 @@ make_block_states! { "waterlogged": Waterlogged(false), }, oxidized_cut_copper_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.0, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, weathered_cut_copper_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.0, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, exposed_cut_copper_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.0, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, cut_copper_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.0, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, waxed_copper_block => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.0, 6.0), {}, @@ -4372,19 +4372,19 @@ make_block_states! { "waterlogged": Waterlogged(false), }, waxed_oxidized_cut_copper_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.0, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, waxed_weathered_cut_copper_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.0, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, waxed_exposed_cut_copper_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.0, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, waxed_cut_copper_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.0, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, copper_door => BlockBehavior::new().strength(3.0, 6.0), { @@ -4556,42 +4556,42 @@ make_block_states! { "powered": Powered(false), }, copper_chest => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.0, 6.0), { - "type": ChestType::Single, + "type": ChestKind::Single, "facing": FacingCardinal::North, "waterlogged": Waterlogged(false), }, exposed_copper_chest => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.0, 6.0), { - "type": ChestType::Single, + "type": ChestKind::Single, "facing": FacingCardinal::North, "waterlogged": Waterlogged(false), }, weathered_copper_chest => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.0, 6.0), { - "type": ChestType::Single, + "type": ChestKind::Single, "facing": FacingCardinal::North, "waterlogged": Waterlogged(false), }, oxidized_copper_chest => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.0, 6.0), { - "type": ChestType::Single, + "type": ChestKind::Single, "facing": FacingCardinal::North, "waterlogged": Waterlogged(false), }, waxed_copper_chest => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.0, 6.0), { - "type": ChestType::Single, + "type": ChestKind::Single, "facing": FacingCardinal::North, "waterlogged": Waterlogged(false), }, waxed_exposed_copper_chest => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.0, 6.0), { - "type": ChestType::Single, + "type": ChestKind::Single, "facing": FacingCardinal::North, "waterlogged": Waterlogged(false), }, waxed_weathered_copper_chest => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.0, 6.0), { - "type": ChestType::Single, + "type": ChestKind::Single, "facing": FacingCardinal::North, "waterlogged": Waterlogged(false), }, waxed_oxidized_copper_chest => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.0, 6.0), { - "type": ChestType::Single, + "type": ChestKind::Single, "facing": FacingCardinal::North, "waterlogged": Waterlogged(false), }, @@ -4735,7 +4735,7 @@ make_block_states! { "waterlogged": Waterlogged(false), }, cobbled_deepslate_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.5, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, cobbled_deepslate_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.5, 6.0).force_solid(true), { @@ -4754,7 +4754,7 @@ make_block_states! { "waterlogged": Waterlogged(false), }, polished_deepslate_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.5, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, polished_deepslate_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.5, 6.0).force_solid(true), { @@ -4773,7 +4773,7 @@ make_block_states! { "waterlogged": Waterlogged(false), }, deepslate_tile_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.5, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, deepslate_tile_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.5, 6.0).force_solid(true), { @@ -4792,7 +4792,7 @@ make_block_states! { "waterlogged": Waterlogged(false), }, deepslate_brick_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.5, 6.0), { - "type": Type::Bottom, + "type": SlabKind::Bottom, "waterlogged": Waterlogged(false), }, deepslate_brick_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.5, 6.0).force_solid(true), { |
