diff options
Diffstat (limited to 'azalea-client/src/plugins/pong.rs')
| -rw-r--r-- | azalea-client/src/plugins/pong.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/azalea-client/src/plugins/pong.rs b/azalea-client/src/plugins/pong.rs index e23b5245..f268a836 100644 --- a/azalea-client/src/plugins/pong.rs +++ b/azalea-client/src/plugins/pong.rs @@ -1,3 +1,4 @@ +use azalea_protocol::packets::{config, game}; use bevy_app::{App, Plugin}; use bevy_ecs::prelude::*; @@ -22,16 +23,16 @@ impl Plugin for PongPlugin { } } -pub fn reply_to_game_ping(trigger: Trigger<PingEvent>, mut commands: Commands) { +pub fn reply_to_game_ping(ping: On<PingEvent>, mut commands: Commands) { commands.trigger(SendPacketEvent::new( - trigger.target(), - azalea_protocol::packets::game::ServerboundPong { id: trigger.0.id }, + ping.entity, + game::ServerboundPong { id: ping.packet.id }, )); } -pub fn reply_to_config_ping(trigger: Trigger<ConfigPingEvent>, mut commands: Commands) { +pub fn reply_to_config_ping(ping: On<ConfigPingEvent>, mut commands: Commands) { commands.trigger(SendConfigPacketEvent::new( - trigger.target(), - azalea_protocol::packets::config::ServerboundPong { id: trigger.0.id }, + ping.entity, + config::ServerboundPong { id: ping.packet.id }, )); } |
