aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2026-03-21 13:07:23 +0700
committermat <git@matdoes.dev>2026-03-23 05:14:23 +1000
commitcac25feb6c43793a84396ac4a19e90df19d1f235 (patch)
tree0e78bb4e88b1c2d91a86cc3a278c9d2c2a944f14
parent88606d9ce9e13fcdd4ab5ce26e52630dee614c1e (diff)
downloadazalea-drasl-cac25feb6c43793a84396ac4a19e90df19d1f235.tar.xz
cleanup and slightly speed up is_block_state_standable
-rw-r--r--CHANGELOG.md2
-rw-r--r--azalea-block/src/block_state.rs2
-rw-r--r--azalea-block/src/generated.rs158
-rw-r--r--azalea-core/src/bitset.rs2
-rw-r--r--azalea/src/entity_ref/shared_impls.rs2
-rw-r--r--azalea/src/pathfinder/world.rs39
-rw-r--r--codegen/lib/code/blocks.py8
7 files changed, 109 insertions, 104 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 89d7f9e4..cc609b9d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -21,7 +21,7 @@ is breaking anyways, semantic versioning is not followed.
- Re-implement `Client::map_component` and `map_get_component`.
- Add `Client::exit` and `Swarm::exit` to make it easier to return from `ClientBuilder::start` or `SwarmBuilder::start`.
- Add `Event::ConnectionFailed` for when the client failed to create its initial connection to the server.
-- `ChunkStorage` can now have custom implementations using `ChunkStorageTrait`.
+- `ChunkStorage` can now have custom implementations using `ChunkStorageTrait`. (@sdwhw)
- Setting blocks now updates `Section::block_count`.
### Changed
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), {
diff --git a/azalea-core/src/bitset.rs b/azalea-core/src/bitset.rs
index b50988b1..5d71b151 100644
--- a/azalea-core/src/bitset.rs
+++ b/azalea-core/src/bitset.rs
@@ -273,6 +273,8 @@ where
#[inline]
pub fn set(&mut self, bit_index: usize) {
+ assert!(bit_index < N);
+
self.data[bit_index / 64] |= 1u64 << (bit_index % 64);
}
}
diff --git a/azalea/src/entity_ref/shared_impls.rs b/azalea/src/entity_ref/shared_impls.rs
index 79396f56..ae3ef42a 100644
--- a/azalea/src/entity_ref/shared_impls.rs
+++ b/azalea/src/entity_ref/shared_impls.rs
@@ -118,7 +118,7 @@ impl_entity_functions! {
///
/// This is a shortcut for `**self.component::<MinecraftEntityId>()`.
EntityRef:
- /// Get the Minecraft UUID of this entity.
+ /// Get the Minecraft ID of this entity.
///
/// See [`MinecraftEntityId`] for more details. For persistent identifiers,
/// consider using [`Self::uuid`] instead.
diff --git a/azalea/src/pathfinder/world.rs b/azalea/src/pathfinder/world.rs
index 6c5d84d2..87b62245 100644
--- a/azalea/src/pathfinder/world.rs
+++ b/azalea/src/pathfinder/world.rs
@@ -6,7 +6,10 @@ use std::{
sync::Arc,
};
-use azalea_block::{BlockState, properties};
+use azalea_block::{
+ BlockState,
+ properties::{self, SlabKind, StairShape},
+};
use azalea_core::{
bitset::FastFixedBitSet,
position::{BlockPos, ChunkPos, ChunkSectionBlockPos},
@@ -218,32 +221,29 @@ impl CachedWorld {
fn calculate_bitsets_for_section(&self, section_pos: SmallChunkSectionPos) -> CachedSection {
let bitsets = self
.with_section(section_pos, |section| {
- let mut passable_bitset = FastFixedBitSet::<4096>::new();
- let mut solid_bitset = FastFixedBitSet::<4096>::new();
- let mut standable_bitset = FastFixedBitSet::<4096>::new();
- let mut water_bitset = FastFixedBitSet::<4096>::new();
+ let mut bitsets = SectionBitsets {
+ passable: FastFixedBitSet::<4096>::new(),
+ solid: FastFixedBitSet::<4096>::new(),
+ standable: FastFixedBitSet::<4096>::new(),
+ water: FastFixedBitSet::<4096>::new(),
+ };
for i in 0..4096 {
let block_state = section.get_at_index(i);
if is_block_state_passable(block_state) {
- passable_bitset.set(i);
+ bitsets.passable.set(i);
}
if is_block_state_solid(block_state) {
- solid_bitset.set(i);
+ bitsets.solid.set(i);
}
if is_block_state_standable(block_state) {
- standable_bitset.set(i);
+ bitsets.standable.set(i);
}
if is_block_state_water(block_state) {
- water_bitset.set(i);
+ bitsets.water.set(i);
}
}
- Box::new(SectionBitsets {
- passable: passable_bitset,
- solid: solid_bitset,
- standable: standable_bitset,
- water: water_bitset,
- })
+ Box::new(bitsets)
})
.unwrap_or_default();
@@ -655,8 +655,8 @@ pub fn is_block_state_solid(block_state: BlockState) -> bool {
}
if matches!(
- block_state.property::<properties::Type>(),
- Some(properties::Type::Top | properties::Type::Double)
+ block_state.property::<properties::SlabKind>(),
+ Some(properties::SlabKind::Top | properties::SlabKind::Double)
) {
// top slabs
return true;
@@ -683,8 +683,9 @@ pub fn is_block_state_standable(block_state: BlockState) -> bool {
return true;
}
- let block = BlockKind::from(block_state);
- if tags::blocks::SLABS.contains(&block) || tags::blocks::STAIRS.contains(&block) {
+ if block_state.property::<SlabKind>().is_some()
+ || block_state.property::<StairShape>().is_some()
+ {
return true;
}
diff --git a/codegen/lib/code/blocks.py b/codegen/lib/code/blocks.py
index 722a0581..672f6420 100644
--- a/codegen/lib/code/blocks.py
+++ b/codegen/lib/code/blocks.py
@@ -212,13 +212,13 @@ def get_property_struct_name(
]:
return "StairShape"
if property_variants == ["normal", "sticky"]:
- return "PistonType"
+ return "PistonKind"
if property_variants == ["x", "z"]:
return "AxisXZ"
if property_variants == ["single", "left", "right"]:
- return "ChestType"
+ return "ChestKind"
if property_variants == ["compare", "subtract"]:
- return "ComparatorType"
+ return "ComparatorKind"
if property_variants == [
"inactive",
"waiting_for_players",
@@ -234,6 +234,8 @@ def get_property_struct_name(
return "TestMode"
if property_variants == ["save", "load", "corner", "data"]:
return "StructureMode"
+ if property_variants == ["top", "bottom", "double"]:
+ return "SlabKind"
if "harp" in property_variants and "didgeridoo" in property_variants:
return "Sound"
if property_variants == ["up", "side", "none"]: