pub struct MoveToBlockGoal {Show 13 fields
block_pos: BlockPos,
target_predicate: Box<dyn Fn(&dyn LevelReader, BlockPos) -> bool + Send + Sync>,
move_to_target: Box<dyn Fn(BlockPos) -> BlockPos + Send + Sync>,
speed_modifier: f64,
next_start_tick: i32,
try_ticks: i32,
max_stay_ticks: i32,
reached_target: bool,
search_range: i32,
vertical_search_range: i32,
vertical_search_start: i32,
accepted_distance: f64,
recalculate_path_interval: i32,
}Fields§
§block_pos: BlockPos§target_predicate: Box<dyn Fn(&dyn LevelReader, BlockPos) -> bool + Send + Sync>§move_to_target: Box<dyn Fn(BlockPos) -> BlockPos + Send + Sync>§speed_modifier: f64§next_start_tick: i32§try_ticks: i32§max_stay_ticks: i32§reached_target: bool§search_range: i32§vertical_search_range: i32§vertical_search_start: i32§accepted_distance: f64§recalculate_path_interval: i32Implementations§
Source§impl MoveToBlockGoal
impl MoveToBlockGoal
pub(crate) fn new( speed_modifier: f64, search_range: i32, target_predicate: impl Fn(&dyn LevelReader, BlockPos) -> bool + Send + Sync + 'static, ) -> Self
pub(crate) fn with_vertical_search_range( speed_modifier: f64, search_range: i32, vertical_search_range: i32, target_predicate: impl Fn(&dyn LevelReader, BlockPos) -> bool + Send + Sync + 'static, ) -> Self
pub(crate) const fn with_vertical_search_start( self, vertical_search_start: i32, ) -> Self
pub(crate) const fn with_accepted_distance(self, accepted_distance: f64) -> Self
pub(crate) const fn with_recalculate_path_interval( self, recalculate_path_interval: i32, ) -> Self
pub(crate) fn with_move_to_target( self, move_to_target: impl Fn(BlockPos) -> BlockPos + Send + Sync + 'static, ) -> Self
pub(crate) const fn block_pos(&self) -> BlockPos
pub(crate) const fn is_reached_target(&self) -> bool
fn next_start_tick(_mob: &dyn PathfinderMob) -> i32
fn move_mob_to_block(&self, mob: &dyn PathfinderMob)
fn move_to_target(&self) -> BlockPos
const fn should_recalculate_path(&self) -> bool
fn find_nearest_block( &mut self, mob: &dyn PathfinderMob, level: &dyn LevelReader, ) -> bool
Trait Implementations§
Source§impl Goal for MoveToBlockGoal
impl Goal for MoveToBlockGoal
fn controls(&self) -> GoalControls
fn requires_update_every_tick(&self) -> bool
fn can_use(&mut self, mob: &dyn PathfinderMob) -> bool
fn can_continue_to_use(&mut self, mob: &dyn PathfinderMob) -> bool
fn start(&mut self, mob: &dyn PathfinderMob)
fn tick(&mut self, mob: &dyn PathfinderMob)
fn is_interruptable(&self) -> bool
fn is_panic_goal(&self) -> bool
fn stop(&mut self, _mob: &dyn PathfinderMob)
Auto Trait Implementations§
impl !RefUnwindSafe for MoveToBlockGoal
impl !UnwindSafe for MoveToBlockGoal
impl Freeze for MoveToBlockGoal
impl Send for MoveToBlockGoal
impl Sync for MoveToBlockGoal
impl Unpin for MoveToBlockGoal
impl UnsafeUnpin for MoveToBlockGoal
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
§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<>>