1919//! /particle a ton of times to show where it's pathfinding to. You should
2020//! only have this on if the bot has operator permissions, otherwise it'll
2121//! just spam the server console unnecessarily.
22+ //! - `--simulation-pathfinder`: Use the alternative simulation-based execution
23+ //! engine for the pathfinder.
2224
2325mod commands;
2426pub mod killaura;
2527
2628use std:: { env, process, sync:: Arc , thread, time:: Duration } ;
2729
2830use azalea:: {
29- ClientInformation , brigadier:: command_dispatcher:: CommandDispatcher , ecs:: prelude:: * ,
30- pathfinder:: debug:: PathfinderDebugParticles , prelude:: * , swarm:: prelude:: * ,
31+ ClientInformation ,
32+ brigadier:: command_dispatcher:: CommandDispatcher ,
33+ ecs:: prelude:: * ,
34+ pathfinder:: {
35+ debug:: PathfinderDebugParticles , execute:: simulation:: SimulationPathfinderExecutionPlugin ,
36+ } ,
37+ prelude:: * ,
38+ swarm:: prelude:: * ,
3139} ;
3240use commands:: { CommandSource , register_commands} ;
3341use parking_lot:: Mutex ;
@@ -44,6 +52,10 @@ async fn main() -> AppExit {
4452 . set_handler ( handle)
4553 . set_swarm_handler ( swarm_handle) ;
4654
55+ if args. simulation_pathfinder {
56+ builder = builder. add_plugins ( SimulationPathfinderExecutionPlugin ) ;
57+ }
58+
4759 for username_or_email in & args. accounts {
4860 let account = if username_or_email. contains ( '@' ) {
4961 Account :: microsoft ( username_or_email) . await . unwrap ( )
@@ -210,13 +222,15 @@ pub struct Args {
210222 pub accounts : Vec < String > ,
211223 pub server : String ,
212224 pub pathfinder_debug_particles : bool ,
225+ pub simulation_pathfinder : bool ,
213226}
214227
215228fn parse_args ( ) -> Args {
216229 let mut owner_username = "admin" . to_owned ( ) ;
217230 let mut accounts = Vec :: new ( ) ;
218231 let mut server = "localhost" . to_owned ( ) ;
219232 let mut pathfinder_debug_particles = false ;
233+ let mut simulation_pathfinder = false ;
220234
221235 let mut args = env:: args ( ) . skip ( 1 ) ;
222236 while let Some ( arg) = args. next ( ) {
@@ -235,6 +249,9 @@ fn parse_args() -> Args {
235249 "--pathfinder-debug-particles" | "-P" => {
236250 pathfinder_debug_particles = true ;
237251 }
252+ "--simulation-pathfinder" => {
253+ simulation_pathfinder = true ;
254+ }
238255 _ => {
239256 eprintln ! ( "Unknown argument: {arg}" ) ;
240257 process:: exit ( 1 ) ;
@@ -251,5 +268,6 @@ fn parse_args() -> Args {
251268 accounts,
252269 server,
253270 pathfinder_debug_particles,
271+ simulation_pathfinder,
254272 }
255273}
0 commit comments