azalea_client/plugins/
brand.rs1use azalea_buf::AzaleaWrite;
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".azalea_write(&mut brand_data).unwrap();
25 commands.trigger(SendConfigPacketEvent::new(
26 entity,
27 ServerboundCustomPayload {
28 identifier: "brand".into(),
29 data: brand_data.into(),
30 },
31 ));
32 }
33}