From 5ed0c5d635b1c28721b3c32f1d6ce04a30934992 Mon Sep 17 00:00:00 2001 From: mat Date: Sun, 28 Sep 2025 16:51:06 +1100 Subject: update deps --- azalea/examples/testbot/commands/debug.rs | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'azalea/examples') diff --git a/azalea/examples/testbot/commands/debug.rs b/azalea/examples/testbot/commands/debug.rs index 23e29b00..3cdf4cf2 100644 --- a/azalea/examples/testbot/commands/debug.rs +++ b/azalea/examples/testbot/commands/debug.rs @@ -14,11 +14,11 @@ use azalea::{ world::MinecraftEntityId, }; use azalea_core::hit_result::HitResult; -use azalea_entity::EntityKindComponent; +use azalea_entity::{EntityKindComponent, EntityUuid, metadata}; use azalea_inventory::components::MaxStackSize; use azalea_world::InstanceContainer; use bevy_app::AppExit; -use bevy_ecs::event::Events; +use bevy_ecs::{event::Events, query::With}; use parking_lot::Mutex; use super::{CommandSource, Ctx}; @@ -214,6 +214,24 @@ pub fn register(commands: &mut CommandDispatcher>) { 1 })); + commands.register(literal("players").executes(|ctx: &Ctx| { + let source = ctx.source.lock(); + let player_entities = source + .bot + .nearest_entities_by::, ()>(|_: &()| true); + let tab_list = source.bot.tab_list(); + for player_entity in player_entities { + let uuid = source.bot.entity_component::(player_entity); + source.reply(format!( + "{} - {} ({:?})", + player_entity, + tab_list.get(&uuid).map_or("?", |p| p.profile.name.as_str()), + uuid + )); + } + 1 + })); + commands.register(literal("debugecsleak").executes(|ctx: &Ctx| { let source = ctx.source.lock(); -- cgit v1.2.3