azalea_client/plugins/
brand.rs1use azalea_buf::AzBuf;
2use azalea_protocol::packets::config::s_custom_payload::ServerboundCustomPayload;
3use bevy_app::prelude::*;
4use bevy_ecs::prelude::*;
5
6use super::packet::config::SendConfigPacketEvent;
7use crate::{client_information::send_client_information, packet::login::InLoginState};
8
9pub struct BrandPlugin;
14impl Plugin for BrandPlugin {
15 fn build(&self, app: &mut App) {
16 app.add_systems(Update, send_brand.before(send_client_information));
17 }
18}
19
20pub fn send_brand(mut commands: Commands, mut removed: RemovedComponents<InLoginState>) {
21 for entity in removed.read() {
22 let mut brand_data = Vec::new();
23 "vanilla"
25 .to_owned()
26 .azalea_write(Default::default(), &mut brand_data)
27 .unwrap();
28 commands.trigger(SendConfigPacketEvent::new(
29 entity,
30 ServerboundCustomPayload {
31 identifier: "brand".into(),
32 data: brand_data.into(),
33 },
34 ));
35 }
36}