diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2023-03-07 22:09:56 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-07 22:09:56 -0600 |
| commit | 5dd35c7ed82c38ef36ca28f630e8d05c5db2cbea (patch) | |
| tree | 72719e46479e7884ea535c768ab7c244ce048063 /azalea/examples/mine_a_chunk.rs | |
| parent | 719379a8a76ab0685f2bd14bebe2f0cd1e97f06b (diff) | |
| download | azalea-drasl-5dd35c7ed82c38ef36ca28f630e8d05c5db2cbea.tar.xz | |
Add World::find_block (#80)
* start adding World::find_block
* keep working on find_block
* BlockStates
* fix sorting
* update examples that use find_one_block
* azalea_block::properties
* fix tests
* add a gotoblock command to testbot
Diffstat (limited to 'azalea/examples/mine_a_chunk.rs')
| -rw-r--r-- | azalea/examples/mine_a_chunk.rs | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/azalea/examples/mine_a_chunk.rs b/azalea/examples/mine_a_chunk.rs deleted file mode 100644 index 74ffacac..00000000 --- a/azalea/examples/mine_a_chunk.rs +++ /dev/null @@ -1,53 +0,0 @@ -use azalea::{prelude::*, swarm::prelude::*}; - -#[tokio::main] -async fn main() { - let mut accounts = Vec::new(); - let mut states = Vec::new(); - - for i in 0..10 { - accounts.push(Account::offline(&format!("bot{i}"))); - states.push(State::default()); - } - - let e = SwarmBuilder::new() - .add_accounts(accounts.clone()) - .set_handler(handle) - .set_swarm_handler(swarm_handle) - .start("localhost") - .await; -} - -#[derive(Default, Clone, Component)] -struct State {} - -#[derive(Default, Clone, Resource)] -struct SwarmState {} - -async fn handle(bot: Client, event: Event, state: State) -> anyhow::Result<()> { - Ok(()) -} - -async fn swarm_handle(swarm: Swarm, event: SwarmEvent, state: SwarmState) -> anyhow::Result<()> { - match &event { - SwarmEvent::Login => { - swarm.goto(azalea::BlockPos::new(0, 70, 0)).await; - // or bots.goto_goal(pathfinder::Goals::Goto(azalea::BlockPos(0, 70, 0))).await; - - // destroy the blocks in this area and then leave - - swarm - .fill( - azalea::Selection::Range( - azalea::BlockPos::new(0, 0, 0), - azalea::BlockPos::new(16, 255, 16), - ), - azalea::block::Air, - ) - .await; - } - _ => {} - } - - Ok(()) -} |
