diff options
| author | mat <git@matdoes.dev> | 2026-01-18 09:50:45 -1245 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2026-01-19 05:35:49 +0700 |
| commit | 268c62587e090c72b67a29e1cc42cda6c9d7340b (patch) | |
| tree | 961d0b4d0bd22d17f4ad6c8b77f02f02566b838e /azalea/examples | |
| parent | fb92f65b3da49b6487bf6fa05010b12a3ab5d4ed (diff) | |
| download | azalea-drasl-268c62587e090c72b67a29e1cc42cda6c9d7340b.tar.xz | |
add simulation-based pathfinder execution engine
Diffstat (limited to 'azalea/examples')
| -rw-r--r-- | azalea/examples/testbot/main.rs | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/azalea/examples/testbot/main.rs b/azalea/examples/testbot/main.rs index b2ad0b61..c74dcee7 100644 --- a/azalea/examples/testbot/main.rs +++ b/azalea/examples/testbot/main.rs @@ -19,6 +19,8 @@ //! /particle a ton of times to show where it's pathfinding to. You should //! only have this on if the bot has operator permissions, otherwise it'll //! just spam the server console unnecessarily. +//! - `--simulation-pathfinder`: Use the alternative simulation-based execution +//! engine for the pathfinder. mod commands; pub mod killaura; @@ -26,8 +28,14 @@ pub mod killaura; use std::{env, process, sync::Arc, thread, time::Duration}; use azalea::{ - ClientInformation, brigadier::command_dispatcher::CommandDispatcher, ecs::prelude::*, - pathfinder::debug::PathfinderDebugParticles, prelude::*, swarm::prelude::*, + ClientInformation, + brigadier::command_dispatcher::CommandDispatcher, + ecs::prelude::*, + pathfinder::{ + debug::PathfinderDebugParticles, execute::simulation::SimulationPathfinderExecutionPlugin, + }, + prelude::*, + swarm::prelude::*, }; use commands::{CommandSource, register_commands}; use parking_lot::Mutex; @@ -44,6 +52,10 @@ async fn main() -> AppExit { .set_handler(handle) .set_swarm_handler(swarm_handle); + if args.simulation_pathfinder { + builder = builder.add_plugins(SimulationPathfinderExecutionPlugin); + } + for username_or_email in &args.accounts { let account = if username_or_email.contains('@') { Account::microsoft(username_or_email).await.unwrap() @@ -210,6 +222,7 @@ pub struct Args { pub accounts: Vec<String>, pub server: String, pub pathfinder_debug_particles: bool, + pub simulation_pathfinder: bool, } fn parse_args() -> Args { @@ -217,6 +230,7 @@ fn parse_args() -> Args { let mut accounts = Vec::new(); let mut server = "localhost".to_owned(); let mut pathfinder_debug_particles = false; + let mut simulation_pathfinder = false; let mut args = env::args().skip(1); while let Some(arg) = args.next() { @@ -235,6 +249,9 @@ fn parse_args() -> Args { "--pathfinder-debug-particles" | "-P" => { pathfinder_debug_particles = true; } + "--simulation-pathfinder" => { + simulation_pathfinder = true; + } _ => { eprintln!("Unknown argument: {arg}"); process::exit(1); @@ -251,5 +268,6 @@ fn parse_args() -> Args { accounts, server, pathfinder_debug_particles, + simulation_pathfinder, } } |
