azalea_client/plugins/
tick_end.rs1use azalea_core::tick::GameTick;
4use azalea_entity::LocalEntity;
5use azalea_physics::PhysicsSystems;
6use azalea_protocol::packets::game::ServerboundClientTickEnd;
7use azalea_world::WorldName;
8use bevy_app::{App, Plugin};
9use bevy_ecs::prelude::*;
10
11use crate::{mining::MiningSystems, packet::game::SendGamePacketEvent};
12
13pub struct TickEndPlugin;
16impl Plugin for TickEndPlugin {
17 fn build(&self, app: &mut App) {
18 app.add_systems(
19 GameTick,
20 game_tick_packet
23 .after(PhysicsSystems)
24 .after(MiningSystems)
25 .after(crate::movement::send_position),
26 );
27 }
28}
29
30pub fn game_tick_packet(
31 query: Query<Entity, (With<LocalEntity>, With<WorldName>)>,
32 mut commands: Commands,
33) {
34 for entity in query.iter() {
35 commands.trigger(SendGamePacketEvent::new(entity, ServerboundClientTickEnd));
36 }
37}