From 2c8b7c5c2c9297273abfba8f7743f1bc25f166b1 Mon Sep 17 00:00:00 2001 From: mat Date: Sun, 28 Sep 2025 13:10:04 -0545 Subject: upgrade bevy to 0.17.0-rc.2 --- azalea/examples/nearest_entity.rs | 4 ++-- azalea/examples/testbot/commands/debug.rs | 24 +++++++++++++----------- 2 files changed, 15 insertions(+), 13 deletions(-) (limited to 'azalea/examples') diff --git a/azalea/examples/nearest_entity.rs b/azalea/examples/nearest_entity.rs index 80bb544d..51aa26f6 100644 --- a/azalea/examples/nearest_entity.rs +++ b/azalea/examples/nearest_entity.rs @@ -12,7 +12,7 @@ use azalea_entity::{ }; use bevy_app::Plugin; use bevy_ecs::{ - prelude::{Entity, EventWriter}, + prelude::{Entity, MessageWriter}, query::With, system::Query, }; @@ -39,7 +39,7 @@ fn look_at_everything( bots: Query, With)>, entities: EntityFinder, entity_positions: Query<(&Position, Option<&EntityDimensions>)>, - mut look_at_event: EventWriter, + mut look_at_event: MessageWriter, ) { for bot_id in bots.iter() { let Some(entity) = entities.nearest_to_entity(bot_id, 16.0) else { diff --git a/azalea/examples/testbot/commands/debug.rs b/azalea/examples/testbot/commands/debug.rs index 3cdf4cf2..b98d737f 100644 --- a/azalea/examples/testbot/commands/debug.rs +++ b/azalea/examples/testbot/commands/debug.rs @@ -18,7 +18,7 @@ use azalea_entity::{EntityKindComponent, EntityUuid, metadata}; use azalea_inventory::components::MaxStackSize; use azalea_world::InstanceContainer; use bevy_app::AppExit; -use bevy_ecs::{event::Events, query::With}; +use bevy_ecs::{message::Messages, query::With, world::EntityRef}; use parking_lot::Mutex; use super::{CommandSource, Ctx}; @@ -246,21 +246,23 @@ pub fn register(commands: &mut CommandDispatcher>) { thread::sleep(Duration::from_secs(1)); // dump the ecs - let ecs = ecs.lock(); + let mut ecs = ecs.lock(); let report_path = env::temp_dir().join("azalea-ecs-leak-report.txt"); let mut report = File::create(&report_path).unwrap(); - for entity in ecs.iter_entities() { + let mut query = ecs.query::(); + for entity in query.iter(& ecs) { writeln!(report, "Entity: {}", entity.id()).unwrap(); let archetype = entity.archetype(); let component_count = archetype.component_count(); let component_names = archetype .components() - .map(|c| ecs.components().get_info(c).unwrap().name()) + .iter() + .map(|c| ecs.components().get_info(*c).unwrap().name().to_string()) .collect::>(); writeln!( report, @@ -274,12 +276,12 @@ pub fn register(commands: &mut CommandDispatcher>) { for (info, _) in ecs.iter_resources() { - let name = info.name(); + let name = info.name().to_string(); writeln!(report, "Resource: {name}").unwrap(); // writeln!(report, "- Size: {} bytes", // info.layout().size()).unwrap(); - match name { + match name.as_ref() { "azalea_world::container::InstanceContainer" => { let instance_container = ecs.resource::(); @@ -311,12 +313,12 @@ pub fn register(commands: &mut CommandDispatcher>) { } } } - "bevy_ecs::event::collections::Events" => { - let events = ecs.resource::>(); + "bevy_ecs::message::Messages" => { + let events = ecs.resource::>(); writeln!(report, "- Event count: {}", events.len()).unwrap(); } - "bevy_ecs::event::collections::Events" => { - let events = ecs.resource::>(); + "bevy_ecs::message::Messages" => { + let events = ecs.resource::>(); writeln!(report, "- Event count: {}", events.len()).unwrap(); } @@ -340,7 +342,7 @@ pub fn register(commands: &mut CommandDispatcher>) { thread::spawn(move || { thread::sleep(Duration::from_secs(1)); - source.lock().bot.ecs.lock().send_event(AppExit::Success); + source.lock().bot.ecs.lock().write_message(AppExit::Success); }); 1 -- cgit v1.2.3