From a5c67d2eee42641323e40f9f891d9690c525f776 Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 2 Jul 2025 01:44:52 -0630 Subject: add FastFixedBitSet and use it in the pathfinder --- azalea/src/pathfinder/world.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'azalea/src') diff --git a/azalea/src/pathfinder/world.rs b/azalea/src/pathfinder/world.rs index e9337503..d130855d 100644 --- a/azalea/src/pathfinder/world.rs +++ b/azalea/src/pathfinder/world.rs @@ -5,7 +5,7 @@ use std::{ use azalea_block::{BlockState, properties}; use azalea_core::{ - bitset::FixedBitSet, + bitset::FastFixedBitSet, position::{BlockPos, ChunkPos, ChunkSectionBlockPos, ChunkSectionPos}, }; use azalea_physics::collision::BlockWithShape; @@ -87,11 +87,11 @@ impl CachedSections { pub struct CachedSection { pub pos: ChunkSectionPos, /// Blocks that we can fully pass through (like air). - pub passable_bitset: FixedBitSet<4096>, + pub passable_bitset: FastFixedBitSet<4096>, /// Blocks that we can stand on and do parkour from. - pub solid_bitset: FixedBitSet<4096>, + pub solid_bitset: FastFixedBitSet<4096>, /// Blocks that we can stand on but might not be able to parkour from. - pub standable_bitset: FixedBitSet<4096>, + pub standable_bitset: FastFixedBitSet<4096>, } impl CachedWorld { @@ -200,9 +200,9 @@ impl CachedWorld { fn calculate_bitsets_for_section(&self, section_pos: ChunkSectionPos) -> Option { self.with_section(section_pos, |section| { - let mut passable_bitset = FixedBitSet::<4096>::new(); - let mut solid_bitset = FixedBitSet::<4096>::new(); - let mut standable_bitset = FixedBitSet::<4096>::new(); + let mut passable_bitset = FastFixedBitSet::<4096>::new(); + let mut solid_bitset = FastFixedBitSet::<4096>::new(); + let mut standable_bitset = FastFixedBitSet::<4096>::new(); for i in 0..4096 { let block_state = section.get_at_index(i); if is_block_state_passable(block_state) { -- cgit v1.2.3