diff options
| author | mat <git@matdoes.dev> | 2025-02-24 04:24:52 +0000 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-02-24 04:24:52 +0000 |
| commit | 7d6cacc79baadc53c7ac9eee735af311423634ad (patch) | |
| tree | 973830546f327cc3fdbdfefcb474daa38c9f8d59 /azalea-client/src/plugins/packet | |
| parent | cfe6bea25a619846bbd5e23022ae572ea487563d (diff) | |
| download | azalea-drasl-7d6cacc79baadc53c7ac9eee735af311423634ad.tar.xz | |
fix send_receivepacketevent running outside of game state
Diffstat (limited to 'azalea-client/src/plugins/packet')
| -rw-r--r-- | azalea-client/src/plugins/packet/game/events.rs | 5 | ||||
| -rw-r--r-- | azalea-client/src/plugins/packet/game/mod.rs | 4 |
2 files changed, 4 insertions, 5 deletions
diff --git a/azalea-client/src/plugins/packet/game/events.rs b/azalea-client/src/plugins/packet/game/events.rs index 19f2a571..9e7f88fa 100644 --- a/azalea-client/src/plugins/packet/game/events.rs +++ b/azalea-client/src/plugins/packet/game/events.rs @@ -5,7 +5,6 @@ use std::{ use azalea_chat::FormattedText; use azalea_core::resource_location::ResourceLocation; -use azalea_entity::LocalEntity; use azalea_protocol::{ packets::{ Packet, @@ -19,7 +18,7 @@ use parking_lot::RwLock; use tracing::{debug, error}; use uuid::Uuid; -use crate::{PlayerInfo, raw_connection::RawConnection}; +use crate::{PlayerInfo, client::InGameState, raw_connection::RawConnection}; /// An event that's sent when we receive a packet. /// ``` @@ -77,7 +76,7 @@ pub fn handle_outgoing_packets( } pub fn send_receivepacketevent( - query: Query<(Entity, &RawConnection), With<LocalEntity>>, + query: Query<(Entity, &RawConnection), With<InGameState>>, mut packet_events: ResMut<Events<ReceivePacketEvent>>, ) { // we manually clear and send the events at the beginning of each update diff --git a/azalea-client/src/plugins/packet/game/mod.rs b/azalea-client/src/plugins/packet/game/mod.rs index 2826295d..c3381e59 100644 --- a/azalea-client/src/plugins/packet/game/mod.rs +++ b/azalea-client/src/plugins/packet/game/mod.rs @@ -749,7 +749,7 @@ impl GamePacketHandler<'_> { ); return; }; - let entity_kind = *entity_kind; + let entity_kind = **entity_kind; debug!("Got set entity data packet {p:?} for entity of kind {entity_kind:?}"); @@ -766,7 +766,7 @@ impl GamePacketHandler<'_> { let mut commands = commands_system_state.get_mut(world); let mut entity_commands = commands.entity(entity_id); if let Err(e) = - apply_metadata(&mut entity_commands, *entity_kind, packed_items) + apply_metadata(&mut entity_commands, entity_kind, packed_items) { warn!("{e}"); } |
