aboutsummaryrefslogtreecommitdiff
path: root/azalea/examples/mine_a_chunk.rs
diff options
context:
space:
mode:
Diffstat (limited to 'azalea/examples/mine_a_chunk.rs')
-rw-r--r--azalea/examples/mine_a_chunk.rs53
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(())
-}