1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 06:16:04 +00:00

doc fixes

This commit is contained in:
mat 2025-05-23 11:20:57 -13:45
parent bacb5c0199
commit 3d340f585a
3 changed files with 4 additions and 12 deletions

View file

@ -131,7 +131,7 @@ pub struct HitResultComponent(HitResult);
pub struct StartUseItemEvent { pub struct StartUseItemEvent {
pub entity: Entity, pub entity: Entity,
pub hand: InteractionHand, pub hand: InteractionHand,
/// See [`QueuedStartUseItem::force_block`]. /// See [`StartUseItemQueued::force_block`].
pub force_block: Option<BlockPos>, pub force_block: Option<BlockPos>,
} }
pub fn handle_start_use_item_event( pub fn handle_start_use_item_event(

View file

@ -89,4 +89,5 @@ impl InstanceContainer {
/// in. If two entities share the same world name, we assume they're in the same /// in. If two entities share the same world name, we assume they're in the same
/// instance. /// instance.
#[derive(Component, Clone, Debug, PartialEq, Deref, DerefMut)] #[derive(Component, Clone, Debug, PartialEq, Deref, DerefMut)]
#[doc(alias("worldname", "world name"))]
pub struct InstanceName(pub ResourceLocation); pub struct InstanceName(pub ResourceLocation);

View file

@ -452,14 +452,6 @@ pub fn calculate_path(opts: CalculatePathOpts) -> Option<PathFoundEvent> {
debug!("this path is empty, we might be stuck :("); debug!("this path is empty, we might be stuck :(");
} }
// replace the RelBlockPos types with BlockPos
// let mapped_path = path
// .into_iter()
// .map(|movement| astar::Movement {
// target: movement.target.apply(origin),
// data: movement.data,
// })
// .collect();
let mut mapped_path = VecDeque::with_capacity(path.len()); let mut mapped_path = VecDeque::with_capacity(path.len());
let mut current_position = RelBlockPos::get_origin(origin); let mut current_position = RelBlockPos::get_origin(origin);
for movement in path { for movement in path {
@ -476,7 +468,7 @@ pub fn calculate_path(opts: CalculatePathOpts) -> Option<PathFoundEvent> {
); );
current_position = found_edge.movement.target; current_position = found_edge.movement.target;
// we don't just copy the found_edge because we're using BlockPos instead of // we don't just clone the found_edge because we're using BlockPos instead of
// RelBlockPos as the target type // RelBlockPos as the target type
mapped_path.push_back(Edge { mapped_path.push_back(Edge {
movement: astar::Movement { movement: astar::Movement {
@ -966,8 +958,7 @@ pub fn recalculate_near_end_of_path(
allow_mining: pathfinder.allow_mining, allow_mining: pathfinder.allow_mining,
min_timeout: if executing_path.path.len() == 50 { min_timeout: if executing_path.path.len() == 50 {
// we have quite some time until the node is reached, soooo we might as // we have quite some time until the node is reached, soooo we might as
// well burn some cpu cycles to get a good // well burn some cpu cycles to get a good path
// path
PathfinderTimeout::Time(Duration::from_secs(5)) PathfinderTimeout::Time(Duration::from_secs(5))
} else { } else {
PathfinderTimeout::Time(Duration::from_secs(1)) PathfinderTimeout::Time(Duration::from_secs(1))