steel_protocol/packets/game/c_remove_player_info.rs
1//! Packet to remove players from the player list (tab menu).
2
3use steel_macros::{ClientPacket, WriteTo};
4use steel_registry::packets::play::C_PLAYER_INFO_REMOVE;
5use uuid::Uuid;
6
7/// Removes players from the client's player list.
8#[derive(ClientPacket, WriteTo, Clone, Debug)]
9#[packet_id(Play = C_PLAYER_INFO_REMOVE)]
10pub struct CRemovePlayerInfo {
11 #[write(as = Prefixed(VarInt))]
12 pub uuids: Vec<Uuid>,
13}
14
15impl CRemovePlayerInfo {
16 /// Creates a packet to remove a single player.
17 #[must_use]
18 pub fn single(uuid: Uuid) -> Self {
19 Self { uuids: vec![uuid] }
20 }
21}