From 6eee543a3367d38a6f0e9bffb457a2bd76a8f9cc Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Sat, 12 Nov 2022 23:54:05 -0600 Subject: Pathfinder (#25) Pathfinding is very much not done, but it works enough and I want to get this merged. TODO: fast replanning, goals that aren't a single node, falling moves (it should be able to play the dropper), parkour moves --- azalea/examples/craft_dig_straight_down.rs | 2 +- azalea/examples/echo.rs | 2 +- azalea/examples/mine_a_chunk.rs | 6 +++--- azalea/examples/potatobot/README.md | 0 azalea/examples/potatobot/autoeat.rs | 3 ++- azalea/examples/potatobot/main.rs | 6 +----- azalea/examples/pvp.rs | 4 ++-- 7 files changed, 10 insertions(+), 13 deletions(-) mode change 100644 => 100755 azalea/examples/craft_dig_straight_down.rs mode change 100644 => 100755 azalea/examples/echo.rs mode change 100644 => 100755 azalea/examples/mine_a_chunk.rs mode change 100644 => 100755 azalea/examples/potatobot/README.md mode change 100644 => 100755 azalea/examples/potatobot/autoeat.rs mode change 100644 => 100755 azalea/examples/potatobot/main.rs mode change 100644 => 100755 azalea/examples/pvp.rs (limited to 'azalea/examples') diff --git a/azalea/examples/craft_dig_straight_down.rs b/azalea/examples/craft_dig_straight_down.rs old mode 100644 new mode 100755 index 82960a9c..d6c0ed1c --- a/azalea/examples/craft_dig_straight_down.rs +++ b/azalea/examples/craft_dig_straight_down.rs @@ -17,7 +17,7 @@ async fn main() { account, address: "localhost", state: State::default(), - plugins: vec![], + plugins: plugins![], handle, }) .await diff --git a/azalea/examples/echo.rs b/azalea/examples/echo.rs old mode 100644 new mode 100755 index 8c11d6e7..51896e53 --- a/azalea/examples/echo.rs +++ b/azalea/examples/echo.rs @@ -11,7 +11,7 @@ async fn main() { account, address: "localhost", state: State::default(), - plugins: vec![], + plugins: plugins![], handle, }) .await diff --git a/azalea/examples/mine_a_chunk.rs b/azalea/examples/mine_a_chunk.rs old mode 100644 new mode 100755 index 3bb712fa..2e30b2c5 --- a/azalea/examples/mine_a_chunk.rs +++ b/azalea/examples/mine_a_chunk.rs @@ -1,4 +1,4 @@ -use azalea::{pathfinder, Account, Accounts, Client, Event, Swarm}; +use azalea::{Account, Accounts, Client, Event, Swarm}; use parking_lot::Mutex; use std::sync::Arc; @@ -17,8 +17,8 @@ async fn main() { swarm_state: State::default(), state: State::default(), - swarm_plugins: vec![Arc::new(pathfinder::Plugin::default())], - plugins: vec![], + swarm_plugins: plugins![azalea_pathfinder::Plugin::default()], + plugins: plugins![], handle: Box::new(handle), swarm_handle: Box::new(swarm_handle), diff --git a/azalea/examples/potatobot/README.md b/azalea/examples/potatobot/README.md old mode 100644 new mode 100755 diff --git a/azalea/examples/potatobot/autoeat.rs b/azalea/examples/potatobot/autoeat.rs old mode 100644 new mode 100755 index 8042e2a2..0f0ccc6d --- a/azalea/examples/potatobot/autoeat.rs +++ b/azalea/examples/potatobot/autoeat.rs @@ -2,7 +2,8 @@ use async_trait::async_trait; use azalea::{Client, Event}; -use std::sync::{Arc, Mutex}; +use parking_lot::Mutex; +use std::sync::Arc; #[derive(Default, Clone)] pub struct Plugin { diff --git a/azalea/examples/potatobot/main.rs b/azalea/examples/potatobot/main.rs old mode 100644 new mode 100755 index 54c84570..66ddfcc0 --- a/azalea/examples/potatobot/main.rs +++ b/azalea/examples/potatobot/main.rs @@ -1,5 +1,4 @@ mod autoeat; - use azalea::prelude::*; use azalea::{pathfinder, BlockPos, ItemKind, Vec3}; @@ -16,10 +15,7 @@ async fn main() { account, address: "localhost", state: State::default(), - plugins: vec![ - Box::new(autoeat::Plugin::default()), - Box::new(pathfinder::Plugin::default()), - ], + plugins: plugins![autoeat::Plugin::default(), pathfinder::Plugin::default(),], handle, }) .await diff --git a/azalea/examples/pvp.rs b/azalea/examples/pvp.rs old mode 100644 new mode 100755 index ec2a08f0..435c335c --- a/azalea/examples/pvp.rs +++ b/azalea/examples/pvp.rs @@ -15,8 +15,8 @@ async fn main() { swarm_state: State::default(), state: State::default(), - swarm_plugins: vec![Box::new(pathfinder::Plugin::default())], - plugins: vec![], + swarm_plugins: plugins![pathfinder::Plugin::default()], + plugins: plugins![], handle: Box::new(handle), swarm_handle: Box::new(swarm_handle), -- cgit v1.2.3