aboutsummaryrefslogtreecommitdiff
path: root/azalea/src
diff options
context:
space:
mode:
authorUbuntu <github@matdoes.dev>2022-11-15 20:38:32 +0000
committerUbuntu <github@matdoes.dev>2022-11-15 20:38:32 +0000
commit614c0df0537567c75f781df7affc091a4a466226 (patch)
treeffd4b23e4692cbdd6c966d389901fbe24d0ad76b /azalea/src
parent9f78b3f4a7229033a3f5acaad6c8fffbe24e3e75 (diff)
downloadazalea-drasl-614c0df0537567c75f781df7affc091a4a466226.tar.xz
clippy
Diffstat (limited to 'azalea/src')
-rwxr-xr-xazalea/src/bot.rs8
-rw-r--r--azalea/src/pathfinder/mod.rs2
-rw-r--r--azalea/src/pathfinder/moves.rs2
-rw-r--r--azalea/src/pathfinder/mtdstarlite.rs2
4 files changed, 6 insertions, 8 deletions
diff --git a/azalea/src/bot.rs b/azalea/src/bot.rs
index 961f093d..0becaa62 100755
--- a/azalea/src/bot.rs
+++ b/azalea/src/bot.rs
@@ -38,11 +38,9 @@ impl BotTrait for azalea_client::Client {
impl crate::Plugin for Plugin {
async fn handle(self: Box<Self>, event: Event, mut bot: Client) {
if let Event::Tick = event {
- if *self.state.jumping_once.lock() {
- if bot.jumping() {
- *self.state.jumping_once.lock() = false;
- bot.set_jumping(false);
- }
+ if *self.state.jumping_once.lock() && bot.jumping() {
+ *self.state.jumping_once.lock() = false;
+ bot.set_jumping(false);
}
}
}
diff --git a/azalea/src/pathfinder/mod.rs b/azalea/src/pathfinder/mod.rs
index d62b3e05..9fd9fe90 100644
--- a/azalea/src/pathfinder/mod.rs
+++ b/azalea/src/pathfinder/mod.rs
@@ -77,7 +77,7 @@ impl Trait for azalea_client::Client {
let dimension = self.dimension.read();
for possible_move in possible_moves.iter() {
edges.push(Edge {
- target: possible_move.next_node(&node),
+ target: possible_move.next_node(node),
cost: possible_move.cost(&dimension, node),
});
}
diff --git a/azalea/src/pathfinder/moves.rs b/azalea/src/pathfinder/moves.rs
index ed98b70d..a08d4b80 100644
--- a/azalea/src/pathfinder/moves.rs
+++ b/azalea/src/pathfinder/moves.rs
@@ -29,7 +29,7 @@ fn is_passable(pos: &BlockPos, dim: &Dimension) -> bool {
/// Whether we can stand in this position. Checks if the block below is solid,
/// and that the two blocks above that are passable.
fn is_standable(pos: &BlockPos, dim: &Dimension) -> bool {
- is_block_solid(&pos.down(1), dim) && is_passable(&pos, dim)
+ is_block_solid(&pos.down(1), dim) && is_passable(pos, dim)
}
const JUMP_COST: f32 = 0.5;
diff --git a/azalea/src/pathfinder/mtdstarlite.rs b/azalea/src/pathfinder/mtdstarlite.rs
index 8a40ec37..ff0fe4cc 100644
--- a/azalea/src/pathfinder/mtdstarlite.rs
+++ b/azalea/src/pathfinder/mtdstarlite.rs
@@ -105,7 +105,7 @@ impl<
for n in &known_nodes {
*pf.state_mut(n) = NodeState::default();
}
- (*pf.state_mut(&start)).rhs = W::default();
+ pf.state_mut(&start).rhs = W::default();
pf.open.push(start, pf.calculate_key(&start));
pf