diff options
| author | mat <git@matdoes.dev> | 2023-11-18 00:07:25 -0600 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2023-11-18 00:07:25 -0600 |
| commit | e39de79a6b5913cab2ee59cff492317a24726ba4 (patch) | |
| tree | a2560e94b9a49c263f8da60bafd2ad3bf5dae19f /azalea/examples | |
| parent | 03cc28d8e71ed969b21a0824a93dd8e2671e3178 (diff) | |
| download | azalea-drasl-e39de79a6b5913cab2ee59cff492317a24726ba4.tar.xz | |
simplify some code
Diffstat (limited to 'azalea/examples')
| -rw-r--r-- | azalea/examples/testbot.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/azalea/examples/testbot.rs b/azalea/examples/testbot.rs index 10bb9e4a..a7f34a77 100644 --- a/azalea/examples/testbot.rs +++ b/azalea/examples/testbot.rs @@ -47,7 +47,7 @@ async fn main() -> anyhow::Result<()> { let mut accounts = Vec::new(); - for i in 0..1 { + for i in 0..200 { accounts.push(Account::offline(&format!("bot{i}"))); } @@ -98,10 +98,7 @@ async fn handle(mut bot: Client, event: Event, _state: State) -> anyhow::Result< // .find(|e| e.name() == Some(sender)); // let entity = bot.entity_by::<With<Player>>(|name: &Name| name == sender); let entity = bot.entity_by::<With<Player>, (&GameProfileComponent,)>( - |(profile,): &(&GameProfileComponent,)| { - println!("entity {profile:?}"); - profile.name == sender - }, + |(profile,): &(&GameProfileComponent,)| profile.name == sender, ); println!("sender entity: {entity:?}"); match m.content().as_str() { |
