aboutsummaryrefslogtreecommitdiff
path: root/azalea/examples
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2022-11-12 23:54:05 -0600
committerGitHub <noreply@github.com>2022-11-12 23:54:05 -0600
commit6eee543a3367d38a6f0e9bffb457a2bd76a8f9cc (patch)
treea5e493ccd7ec24293b8d866242c3836146517122 /azalea/examples
parentfa57d03627aa20b1df44caed7cb025b6db1d9b53 (diff)
downloadazalea-drasl-6eee543a3367d38a6f0e9bffb457a2bd76a8f9cc.tar.xz
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
Diffstat (limited to 'azalea/examples')
-rwxr-xr-x[-rw-r--r--]azalea/examples/craft_dig_straight_down.rs2
-rwxr-xr-x[-rw-r--r--]azalea/examples/echo.rs2
-rwxr-xr-x[-rw-r--r--]azalea/examples/mine_a_chunk.rs6
-rwxr-xr-x[-rw-r--r--]azalea/examples/potatobot/README.md0
-rwxr-xr-x[-rw-r--r--]azalea/examples/potatobot/autoeat.rs3
-rwxr-xr-x[-rw-r--r--]azalea/examples/potatobot/main.rs6
-rwxr-xr-x[-rw-r--r--]azalea/examples/pvp.rs4
7 files changed, 10 insertions, 13 deletions
diff --git a/azalea/examples/craft_dig_straight_down.rs b/azalea/examples/craft_dig_straight_down.rs
index 82960a9c..d6c0ed1c 100644..100755
--- 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
index 8c11d6e7..51896e53 100644..100755
--- 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
index 3bb712fa..2e30b2c5 100644..100755
--- 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
index e494316e..e494316e 100644..100755
--- a/azalea/examples/potatobot/README.md
+++ b/azalea/examples/potatobot/README.md
diff --git a/azalea/examples/potatobot/autoeat.rs b/azalea/examples/potatobot/autoeat.rs
index 8042e2a2..0f0ccc6d 100644..100755
--- 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
index 54c84570..66ddfcc0 100644..100755
--- 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
index ec2a08f0..435c335c 100644..100755
--- 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),