pub struct PathNavigation {Show 25 fields
path: Option<Path>,
path_finder: PathFinder,
path_type_cache: PathTypeCache,
direct_target: Option<DVec3>,
target_pos: Option<BlockPos>,
speed_modifier: f64,
max_visited_nodes_multiplier: f32,
required_path_length: f32,
reach_range: i32,
tick: i32,
last_stuck_check: i32,
last_stuck_check_pos: DVec3,
timeout_cached_node: BlockPos,
timeout_timer: i64,
last_timeout_check: i64,
timeout_limit: f64,
has_delayed_recomputation: bool,
time_last_recompute: i64,
stuck: bool,
done: bool,
can_float: bool,
can_open_doors: bool,
can_walk_over_fences: bool,
avoid_sun: bool,
can_path_to_targets_below_surface: bool,
}Fields§
§path: Option<Path>§path_finder: PathFinder§path_type_cache: PathTypeCache§direct_target: Option<DVec3>§target_pos: Option<BlockPos>§speed_modifier: f64§max_visited_nodes_multiplier: f32§required_path_length: f32§reach_range: i32§tick: i32§last_stuck_check: i32§last_stuck_check_pos: DVec3§timeout_cached_node: BlockPos§timeout_timer: i64§last_timeout_check: i64§timeout_limit: f64§has_delayed_recomputation: bool§time_last_recompute: i64§stuck: bool§done: bool§can_float: bool§can_open_doors: bool§can_walk_over_fences: bool§avoid_sun: bool§can_path_to_targets_below_surface: boolImplementations§
pub fn new() -> Self
pub const fn path(&self) -> Option<&Path>
pub const fn target_pos(&self) -> Option<BlockPos>
pub const fn speed_modifier(&self) -> f64
pub const fn set_speed_modifier(&mut self, speed_modifier: f64)
pub const fn reach_range(&self) -> i32
pub const fn required_path_length(&self) -> f32
pub const fn max_visited_nodes_multiplier(&self) -> f32
pub fn set_required_path_length( &mut self, required_path_length: f32, follow_range: f64, )
pub const fn reset_max_visited_nodes_multiplier(&mut self)
pub const fn set_max_visited_nodes_multiplier( &mut self, max_visited_nodes_multiplier: f32, )
pub const fn is_done(&self) -> bool
pub const fn tick_count(&self) -> i32
pub const fn is_stuck(&self) -> bool
pub const fn has_delayed_recomputation(&self) -> bool
pub const fn can_float(&self) -> bool
pub const fn set_can_float(&mut self, can_float: bool)
pub const fn can_open_doors(&self) -> bool
pub const fn set_can_open_doors(&mut self, can_open_doors: bool)
pub const fn can_walk_over_fences(&self) -> bool
pub const fn set_can_walk_over_fences(&mut self, can_walk_over_fences: bool)
pub const fn avoid_sun(&self) -> bool
pub const fn set_avoid_sun(&mut self, avoid_sun: bool)
pub const fn can_path_to_targets_below_surface(&self) -> bool
pub const fn set_can_path_to_targets_below_surface( &mut self, can_path_to_targets_below_surface: bool, )
pub const fn tick(&mut self)
pub fn invalidate_path_type(&mut self, pos: BlockPos)
pub fn stop(&mut self)
pub const fn max_path_length(&self, follow_range: f64) -> f32
pub fn update_pathfinder_max_visited_nodes(&mut self, follow_range: f64)
pub fn create_path( &mut self, evaluator: &mut WalkNodeEvaluator, level: &dyn LevelReader, collision: &mut impl WalkNodeCollision, request: NavigationPathRequest<'_>, ) -> Option<Path>
fn reusable_current_path(&self, targets: &[BlockPos]) -> Option<&Path>
fn trim_path_for_avoid_sun( &self, level: &dyn LevelReader, mob_position: DVec3, path: &mut Path, )
fn trim_path( &self, level: &dyn LevelReader, mob_position: DVec3, path: &mut Path, )
fn trim_path_for_cauldrons(level: &dyn LevelReader, path: &mut Path)
pub fn move_to( &mut self, level: &dyn LevelReader, path: Path, speed_modifier: f64, mob_position: DVec3, ) -> bool
pub fn reuse_current_path_to_targets( &mut self, level: &dyn LevelReader, targets: &[BlockPos], speed_modifier: f64, mob_position: DVec3, ) -> bool
pub fn set_direct_target(&mut self, target: DVec3, speed_modifier: f64)
pub fn next_move_target( &mut self, context: NavigationTickContext, ) -> Option<(DVec3, f64)>
pub fn next_move_target_without_path_update( &mut self, context: NavigationTickContext, on_ground: bool, ) -> Option<(DVec3, f64)>
pub fn request_recompute_path( &mut self, game_time: i64, can_update_path: bool, ) -> Option<NavigationRecomputeRequest>
pub fn take_delayed_recompute_request( &mut self, game_time: i64, can_update_path: bool, ) -> Option<NavigationRecomputeRequest>
pub fn complete_recompute_path(&mut self, path: Option<Path>, game_time: i64)
pub fn should_recompute_path(&self, pos: BlockPos, mob_position: DVec3) -> bool
fn next_path_move_target( &mut self, context: NavigationTickContext, ) -> Option<(DVec3, f64)>
fn do_stuck_detection( &mut self, mob_position: DVec3, mob_speed: f32, game_time: i64, )
fn timeout_path(&mut self)
const fn reset_stuck_timeout(&mut self)
Trait Implementations§
Source§fn clone(&self) -> PathNavigation
fn clone(&self) -> PathNavigation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreWraps this value in an
Arc<SyncMutex<>>