Skip to main content

azalea_protocol/packets/game/
c_set_player_team.rs

1use azalea_buf::AzBuf;
2use azalea_chat::{FormattedText, style::ChatFormatting};
3use azalea_protocol_macros::ClientboundGamePacket;
4
5#[derive(AzBuf, ClientboundGamePacket, Clone, Debug, PartialEq)]
6pub struct ClientboundSetPlayerTeam {
7    pub name: String,
8    pub method: Method,
9}
10
11#[derive(AzBuf, Clone, Debug, PartialEq)]
12pub enum Method {
13    Add((Parameters, PlayerList)),
14    Remove,
15    Change(Parameters),
16    Join(PlayerList),
17    Leave(PlayerList),
18}
19
20#[derive(AzBuf, Clone, Debug, PartialEq)]
21pub struct Parameters {
22    pub display_name: FormattedText,
23    pub player_prefix: FormattedText,
24    pub player_suffix: FormattedText,
25    pub nametag_visibility: NameTagVisibility,
26    pub collision_rule: CollisionRule,
27    pub color: ChatFormatting,
28    pub options: u8,
29}
30
31#[derive(AzBuf, Clone, Copy, Debug, PartialEq)]
32pub enum CollisionRule {
33    Always,
34    Never,
35    PushOtherTeams,
36    PushOwnTeam,
37}
38
39#[derive(AzBuf, Clone, Copy, Debug, PartialEq)]
40pub enum NameTagVisibility {
41    Always,
42    Never,
43    HideForOtherTeams,
44    HideForOwnTeam,
45}
46
47type PlayerList = Vec<String>;