diff options
| author | mat <git@matdoes.dev> | 2024-02-17 14:43:42 -0600 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2024-02-17 14:43:42 -0600 |
| commit | be4f13c36c281f086602092098522b3f25fc0680 (patch) | |
| tree | 599d2de84d06d7d1c31a908a2e89499c62e0a5ca /azalea-client/src | |
| parent | 64d48897afe5bcb40931f8ef8b3594fe275751e8 (diff) | |
| download | azalea-drasl-be4f13c36c281f086602092098522b3f25fc0680.tar.xz | |
upgrade deps, bevy 0.13
Diffstat (limited to 'azalea-client/src')
| -rw-r--r-- | azalea-client/src/entity_query.rs | 21 | ||||
| -rw-r--r-- | azalea-client/src/interact.rs | 2 | ||||
| -rw-r--r-- | azalea-client/src/inventory.rs | 2 | ||||
| -rw-r--r-- | azalea-client/src/mining.rs | 4 | ||||
| -rw-r--r-- | azalea-client/src/packet_handling/game.rs | 4 |
5 files changed, 17 insertions, 16 deletions
diff --git a/azalea-client/src/entity_query.rs b/azalea-client/src/entity_query.rs index 42b7b0ca..be892ee5 100644 --- a/azalea-client/src/entity_query.rs +++ b/azalea-client/src/entity_query.rs @@ -3,7 +3,8 @@ use std::sync::Arc; use bevy_ecs::{ component::Component, entity::Entity, - query::{ROQueryItem, ReadOnlyWorldQuery, WorldQuery}, + query::QueryData, + query::{QueryFilter, ROQueryItem}, world::World, }; use parking_lot::Mutex; @@ -22,13 +23,13 @@ impl Client { /// .is_some(); /// # } /// ``` - pub fn query<'w, Q: WorldQuery>(&self, ecs: &'w mut World) -> <Q as WorldQuery>::Item<'w> { - ecs.query::<Q>() + pub fn query<'w, D: QueryData>(&self, ecs: &'w mut World) -> D::Item<'w> { + ecs.query::<D>() .get_mut(ecs, self.entity) .unwrap_or_else(|_| { panic!( "Our client is missing a required component {:?}", - std::any::type_name::<Q>() + std::any::type_name::<D>() ) }) } @@ -58,7 +59,7 @@ impl Client { /// ``` /// /// [`Entity`]: bevy_ecs::entity::Entity - pub fn entity_by<F: ReadOnlyWorldQuery, Q: ReadOnlyWorldQuery>( + pub fn entity_by<F: QueryFilter, Q: QueryData>( &mut self, predicate: impl EntityPredicate<Q, F>, ) -> Option<Entity> { @@ -93,14 +94,14 @@ impl Client { } } -pub trait EntityPredicate<Q: ReadOnlyWorldQuery, Filter: ReadOnlyWorldQuery> { +pub trait EntityPredicate<Q: QueryData, Filter: QueryFilter> { fn find(&self, ecs_lock: Arc<Mutex<World>>) -> Option<Entity>; } impl<F, Q, Filter> EntityPredicate<Q, Filter> for F where F: Fn(&ROQueryItem<Q>) -> bool, - Q: ReadOnlyWorldQuery, - Filter: ReadOnlyWorldQuery, + Q: QueryData, + Filter: QueryFilter, { fn find(&self, ecs_lock: Arc<Mutex<World>>) -> Option<Entity> { let mut ecs = ecs_lock.lock(); @@ -114,8 +115,8 @@ where // impl<'a, F, Q1, Q2> EntityPredicate<'a, (Q1, Q2)> for F // where // F: Fn(&<Q1 as WorldQuery>::Item<'_>, &<Q2 as WorldQuery>::Item<'_>) -> -// bool, Q1: ReadOnlyWorldQuery, -// Q2: ReadOnlyWorldQuery, +// bool, Q1: QueryFilter, +// Q2: QueryFilter, // { // fn find(&self, ecs: &mut Ecs) -> Option<Entity> { // // (self)(query) diff --git a/azalea-client/src/interact.rs b/azalea-client/src/interact.rs index 026e94ca..8a3aa49b 100644 --- a/azalea-client/src/interact.rs +++ b/azalea-client/src/interact.rs @@ -156,7 +156,7 @@ pub fn handle_block_interact_event( sequence: sequence_number.0, } .get(), - }) + }); } } diff --git a/azalea-client/src/inventory.rs b/azalea-client/src/inventory.rs index bf421bf4..4bfed69f 100644 --- a/azalea-client/src/inventory.rs +++ b/azalea-client/src/inventory.rs @@ -708,7 +708,7 @@ pub fn handle_container_click_event( carried_item: inventory.carried.clone(), } .get(), - }) + }); } } diff --git a/azalea-client/src/mining.rs b/azalea-client/src/mining.rs index d2e66ca8..f0b86db1 100644 --- a/azalea-client/src/mining.rs +++ b/azalea-client/src/mining.rs @@ -253,7 +253,7 @@ fn handle_start_mining_block_with_direction_event( entity: event.entity, position: event.position, destroy_stage: mine_progress.destroy_stage(), - }) + }); } send_packet_events.send(SendPacketEvent { @@ -572,7 +572,7 @@ fn continue_mining_block( entity, position: mining.pos, direction: mining.dir, - }) + }); } swing_arm_events.send(SwingArmEvent { entity }); diff --git a/azalea-client/src/packet_handling/game.rs b/azalea-client/src/packet_handling/game.rs index 91a3c835..080ef270 100644 --- a/azalea-client/src/packet_handling/game.rs +++ b/azalea-client/src/packet_handling/game.rs @@ -1176,7 +1176,7 @@ pub fn process_packet_events(ecs: &mut World) { let mut client_side_close_container_events = system_state.get_mut(ecs); client_side_close_container_events.send(ClientSideCloseContainerEvent { entity: player_entity, - }) + }); } ClientboundGamePacket::Cooldown(_) => {} ClientboundGamePacket::CustomChatCompletions(_) => {} @@ -1225,7 +1225,7 @@ pub fn process_packet_events(ecs: &mut World) { window_id: p.container_id, menu_type: p.menu_type, title: p.title.to_owned(), - }) + }); } ClientboundGamePacket::OpenSignEditor(_) => {} ClientboundGamePacket::Ping(p) => { |
