From efc28db6cfa3cf45561610dcba9b2819553aa025 Mon Sep 17 00:00:00 2001 From: mat Date: Sat, 5 Apr 2025 01:46:14 +0330 Subject: remove unnecessary ecs system ordering for handle_outgoing_packets --- azalea-client/src/plugins/brand.rs | 11 ++++------- azalea-client/src/plugins/chat/mod.rs | 7 +------ azalea-client/src/plugins/chunks.rs | 2 -- azalea-client/src/plugins/interact.rs | 2 -- azalea-client/src/plugins/inventory.rs | 3 +-- azalea-client/src/plugins/respawn.rs | 3 +-- 6 files changed, 7 insertions(+), 21 deletions(-) (limited to 'azalea-client/src/plugins') diff --git a/azalea-client/src/plugins/brand.rs b/azalea-client/src/plugins/brand.rs index 94783230..cf179e71 100644 --- a/azalea-client/src/plugins/brand.rs +++ b/azalea-client/src/plugins/brand.rs @@ -17,24 +17,21 @@ use crate::packet::login::InLoginState; pub struct BrandPlugin; impl Plugin for BrandPlugin { fn build(&self, app: &mut App) { - app.add_systems( - Update, - handle_end_login_state.before(crate::packet::config::handle_outgoing_packets), - ); + app.add_systems(Update, handle_end_login_state); } } pub fn handle_end_login_state( + mut commands: Commands, mut removed: RemovedComponents, query: Query<&ClientInformation>, - mut send_packet_events: EventWriter, ) { for entity in removed.read() { let mut brand_data = Vec::new(); // azalea pretends to be vanilla everywhere else so it makes sense to lie here // too "vanilla".azalea_write(&mut brand_data).unwrap(); - send_packet_events.send(SendConfigPacketEvent::new( + commands.trigger(SendConfigPacketEvent::new( entity, ServerboundCustomPayload { identifier: ResourceLocation::new("brand"), @@ -53,7 +50,7 @@ pub fn handle_end_login_state( }; debug!("Writing ClientInformation while in config state: {client_information:?}"); - send_packet_events.send(SendConfigPacketEvent::new( + commands.trigger(SendConfigPacketEvent::new( entity, ServerboundClientInformation { information: client_information.clone(), diff --git a/azalea-client/src/plugins/chat/mod.rs b/azalea-client/src/plugins/chat/mod.rs index 1e083c94..3d03d24e 100644 --- a/azalea-client/src/plugins/chat/mod.rs +++ b/azalea-client/src/plugins/chat/mod.rs @@ -19,7 +19,6 @@ use bevy_ecs::{ use handler::{SendChatKindEvent, handle_send_chat_kind_event}; use uuid::Uuid; -use super::packet::game::handle_outgoing_packets; use crate::client::Client; pub struct ChatPlugin; @@ -30,11 +29,7 @@ impl Plugin for ChatPlugin { .add_event::() .add_systems( Update, - ( - handle_send_chat_event, - handle_send_chat_kind_event.after(handle_outgoing_packets), - ) - .chain(), + (handle_send_chat_event, handle_send_chat_kind_event).chain(), ); } } diff --git a/azalea-client/src/plugins/chunks.rs b/azalea-client/src/plugins/chunks.rs index 060b94e2..5599d7c9 100644 --- a/azalea-client/src/plugins/chunks.rs +++ b/azalea-client/src/plugins/chunks.rs @@ -16,7 +16,6 @@ use bevy_app::{App, Plugin, Update}; use bevy_ecs::prelude::*; use tracing::{error, trace}; -use super::packet::game::handle_outgoing_packets; use crate::{ InstanceHolder, interact::handle_block_interact_event, inventory::InventorySet, packet::game::SendPacketEvent, respawn::perform_respawn, @@ -33,7 +32,6 @@ impl Plugin for ChunksPlugin { handle_chunk_batch_finished_event, ) .chain() - .before(handle_outgoing_packets) .before(InventorySet) .before(handle_block_interact_event) .before(perform_respawn), diff --git a/azalea-client/src/plugins/interact.rs b/azalea-client/src/plugins/interact.rs index f7239c17..9e638a06 100644 --- a/azalea-client/src/plugins/interact.rs +++ b/azalea-client/src/plugins/interact.rs @@ -31,7 +31,6 @@ use bevy_ecs::{ use derive_more::{Deref, DerefMut}; use tracing::warn; -use super::packet::game::handle_outgoing_packets; use crate::{ Client, attack::handle_attack_event, @@ -56,7 +55,6 @@ impl Plugin for InteractPlugin { handle_block_interact_event, handle_swing_arm_event, ) - .before(handle_outgoing_packets) .after(InventorySet) .after(perform_respawn) .after(handle_attack_event) diff --git a/azalea-client/src/plugins/inventory.rs b/azalea-client/src/plugins/inventory.rs index 844dd248..e6394ab8 100644 --- a/azalea-client/src/plugins/inventory.rs +++ b/azalea-client/src/plugins/inventory.rs @@ -26,7 +26,6 @@ use bevy_ecs::{ }; use tracing::{error, warn}; -use super::packet::game::handle_outgoing_packets; use crate::{ Client, local_player::PlayerAbilities, packet::game::SendPacketEvent, respawn::perform_respawn, }; @@ -47,7 +46,7 @@ impl Plugin for InventoryPlugin { handle_menu_opened_event, handle_set_container_content_event, handle_container_click_event, - handle_container_close_event.before(handle_outgoing_packets), + handle_container_close_event, handle_client_side_close_container_event, ) .chain() diff --git a/azalea-client/src/plugins/respawn.rs b/azalea-client/src/plugins/respawn.rs index 24479805..f0ddd2b8 100644 --- a/azalea-client/src/plugins/respawn.rs +++ b/azalea-client/src/plugins/respawn.rs @@ -2,7 +2,6 @@ use azalea_protocol::packets::game::s_client_command::{self, ServerboundClientCo use bevy_app::{App, Plugin, Update}; use bevy_ecs::prelude::*; -use super::packet::game::handle_outgoing_packets; use crate::packet::game::SendPacketEvent; /// Tell the server that we're respawning. @@ -16,7 +15,7 @@ pub struct RespawnPlugin; impl Plugin for RespawnPlugin { fn build(&self, app: &mut App) { app.add_event::() - .add_systems(Update, perform_respawn.before(handle_outgoing_packets)); + .add_systems(Update, perform_respawn); } } -- cgit v1.2.3