diff --git a/src/protocol/packet.rs b/src/protocol/packet.rs index 93fc393..9e7fb1f 100644 --- a/src/protocol/packet.rs +++ b/src/protocol/packet.rs @@ -1529,17 +1529,30 @@ state_packets!( field passengers: LenPrefixed =, } /// Teams creates and updates teams - packet Teams { + packet Teams_VarInt { field name: String =, field mode: u8 =, - field display_name: Option = when(|p: &Teams| p.mode == 0 || p.mode == 2), - field prefix: Option = when(|p: &Teams| p.mode == 0 || p.mode == 2), - field suffix: Option = when(|p: &Teams| p.mode == 0 || p.mode == 2), - field flags: Option = when(|p: &Teams| p.mode == 0 || p.mode == 2), - field name_tag_visibility: Option = when(|p: &Teams| p.mode == 0 || p.mode == 2), - field collision_rule: Option = when(|p: &Teams| p.mode == 0 || p.mode == 2), - field color: Option = when(|p: &Teams| p.mode == 0 || p.mode == 2), - field players: Option> = when(|p: &Teams| p.mode == 0 || p.mode == 3 || p.mode == 4), + field display_name: Option = when(|p: &Teams_VarInt| p.mode == 0 || p.mode == 2), + field flags: Option = when(|p: &Teams_VarInt| p.mode == 0 || p.mode == 2), + field name_tag_visibility: Option = when(|p: &Teams_VarInt| p.mode == 0 || p.mode == 2), + field collision_rule: Option = when(|p: &Teams_VarInt| p.mode == 0 || p.mode == 2), + field formatting: Option = when(|p: &Teams_VarInt| p.mode == 0 || p.mode == 2), + field prefix: Option = when(|p: &Teams_VarInt| p.mode == 0 || p.mode == 2), + field suffix: Option = when(|p: &Teams_VarInt| p.mode == 0 || p.mode == 2), + field players: Option> = when(|p: &Teams_VarInt| p.mode == 0 || p.mode == 3 || p.mode == 4), + } + packet Teams_u8 { + field name: String =, + field mode: u8 =, + field data: Vec =, + field display_name: Option = when(|p: &Teams_u8| p.mode == 0 || p.mode == 2), + field prefix: Option = when(|p: &Teams_u8| p.mode == 0 || p.mode == 2), + field suffix: Option = when(|p: &Teams_u8| p.mode == 0 || p.mode == 2), + field flags: Option = when(|p: &Teams_u8| p.mode == 0 || p.mode == 2), + field name_tag_visibility: Option = when(|p: &Teams_u8| p.mode == 0 || p.mode == 2), + field collision_rule: Option = when(|p: &Teams_u8| p.mode == 0 || p.mode == 2), + field color: Option = when(|p: &Teams_u8| p.mode == 0 || p.mode == 2), + field players: Option> = when(|p: &Teams_u8| p.mode == 0 || p.mode == 3 || p.mode == 4), } packet Teams_NoVisColor { field name: String =, diff --git a/src/protocol/versions/v15w39c.rs b/src/protocol/versions/v15w39c.rs index f78c0bd..9801571 100644 --- a/src/protocol/versions/v15w39c.rs +++ b/src/protocol/versions/v15w39c.rs @@ -101,7 +101,7 @@ protocol_packet_ids!( 0x3d => SetExperience 0x3e => UpdateHealth 0x3f => ScoreboardObjective - 0x40 => Teams + 0x40 => Teams_u8 0x41 => UpdateScore 0x42 => SpawnPosition 0x43 => TimeUpdate diff --git a/src/protocol/versions/v18w50a.rs b/src/protocol/versions/v18w50a.rs index 93e4628..ffb0d03 100644 --- a/src/protocol/versions/v18w50a.rs +++ b/src/protocol/versions/v18w50a.rs @@ -125,7 +125,7 @@ protocol_packet_ids!( 0x45 => UpdateHealth 0x46 => ScoreboardObjective 0x47 => SetPassengers - 0x48 => Teams + 0x48 => Teams_u8 0x49 => UpdateScore 0x4a => SpawnPosition 0x4b => TimeUpdate diff --git a/src/protocol/versions/v19w02a.rs b/src/protocol/versions/v19w02a.rs index b3ca589..2bc3fa5 100644 --- a/src/protocol/versions/v19w02a.rs +++ b/src/protocol/versions/v19w02a.rs @@ -125,7 +125,7 @@ protocol_packet_ids!( 0x45 => UpdateHealth 0x46 => ScoreboardObjective 0x47 => SetPassengers - 0x48 => Teams + 0x48 => Teams_u8 0x49 => UpdateScore 0x4a => SpawnPosition 0x4b => TimeUpdate diff --git a/src/protocol/versions/v1_10_2.rs b/src/protocol/versions/v1_10_2.rs index 85dc83a..b28c6a8 100644 --- a/src/protocol/versions/v1_10_2.rs +++ b/src/protocol/versions/v1_10_2.rs @@ -105,7 +105,7 @@ protocol_packet_ids!( 0x3e => UpdateHealth 0x3f => ScoreboardObjective 0x40 => SetPassengers - 0x41 => Teams + 0x41 => Teams_u8 0x42 => UpdateScore 0x43 => SpawnPosition 0x44 => TimeUpdate diff --git a/src/protocol/versions/v1_11_2.rs b/src/protocol/versions/v1_11_2.rs index 3db3c06..0a622a8 100644 --- a/src/protocol/versions/v1_11_2.rs +++ b/src/protocol/versions/v1_11_2.rs @@ -105,7 +105,7 @@ protocol_packet_ids!( 0x3e => UpdateHealth 0x3f => ScoreboardObjective 0x40 => SetPassengers - 0x41 => Teams + 0x41 => Teams_u8 0x42 => UpdateScore 0x43 => SpawnPosition 0x44 => TimeUpdate diff --git a/src/protocol/versions/v1_12_2.rs b/src/protocol/versions/v1_12_2.rs index ebd23a0..e98798d 100644 --- a/src/protocol/versions/v1_12_2.rs +++ b/src/protocol/versions/v1_12_2.rs @@ -111,7 +111,7 @@ protocol_packet_ids!( 0x41 => UpdateHealth 0x42 => ScoreboardObjective 0x43 => SetPassengers - 0x44 => Teams + 0x44 => Teams_u8 0x45 => UpdateScore 0x46 => SpawnPosition 0x47 => TimeUpdate diff --git a/src/protocol/versions/v1_13_2.rs b/src/protocol/versions/v1_13_2.rs index 659ed85..325cb44 100644 --- a/src/protocol/versions/v1_13_2.rs +++ b/src/protocol/versions/v1_13_2.rs @@ -124,7 +124,7 @@ protocol_packet_ids!( 0x44 => UpdateHealth 0x45 => ScoreboardObjective 0x46 => SetPassengers - 0x47 => Teams + 0x47 => Teams_VarInt 0x48 => UpdateScore 0x49 => SpawnPosition 0x4a => TimeUpdate diff --git a/src/protocol/versions/v1_14.rs b/src/protocol/versions/v1_14.rs index 98bfb41..07cd5c5 100644 --- a/src/protocol/versions/v1_14.rs +++ b/src/protocol/versions/v1_14.rs @@ -131,7 +131,7 @@ protocol_packet_ids!( 0x48 => UpdateHealth 0x49 => ScoreboardObjective 0x4a => SetPassengers - 0x4b => Teams + 0x4b => Teams_VarInt 0x4c => UpdateScore 0x4d => SpawnPosition 0x4e => TimeUpdate diff --git a/src/protocol/versions/v1_14_1.rs b/src/protocol/versions/v1_14_1.rs index 98bfb41..07cd5c5 100644 --- a/src/protocol/versions/v1_14_1.rs +++ b/src/protocol/versions/v1_14_1.rs @@ -131,7 +131,7 @@ protocol_packet_ids!( 0x48 => UpdateHealth 0x49 => ScoreboardObjective 0x4a => SetPassengers - 0x4b => Teams + 0x4b => Teams_VarInt 0x4c => UpdateScore 0x4d => SpawnPosition 0x4e => TimeUpdate diff --git a/src/protocol/versions/v1_14_2.rs b/src/protocol/versions/v1_14_2.rs index 98bfb41..07cd5c5 100644 --- a/src/protocol/versions/v1_14_2.rs +++ b/src/protocol/versions/v1_14_2.rs @@ -131,7 +131,7 @@ protocol_packet_ids!( 0x48 => UpdateHealth 0x49 => ScoreboardObjective 0x4a => SetPassengers - 0x4b => Teams + 0x4b => Teams_VarInt 0x4c => UpdateScore 0x4d => SpawnPosition 0x4e => TimeUpdate diff --git a/src/protocol/versions/v1_14_3.rs b/src/protocol/versions/v1_14_3.rs index e5dcc1d..83d4f32 100644 --- a/src/protocol/versions/v1_14_3.rs +++ b/src/protocol/versions/v1_14_3.rs @@ -131,7 +131,7 @@ protocol_packet_ids!( 0x48 => UpdateHealth 0x49 => ScoreboardObjective 0x4a => SetPassengers - 0x4b => Teams + 0x4b => Teams_VarInt 0x4c => UpdateScore 0x4d => SpawnPosition 0x4e => TimeUpdate diff --git a/src/protocol/versions/v1_14_4.rs b/src/protocol/versions/v1_14_4.rs index 8e7e35b..0ba3d73 100644 --- a/src/protocol/versions/v1_14_4.rs +++ b/src/protocol/versions/v1_14_4.rs @@ -131,7 +131,7 @@ protocol_packet_ids!( 0x48 => UpdateHealth 0x49 => ScoreboardObjective 0x4a => SetPassengers - 0x4b => Teams + 0x4b => Teams_VarInt 0x4c => UpdateScore 0x4d => SpawnPosition 0x4e => TimeUpdate diff --git a/src/protocol/versions/v1_8_9.rs b/src/protocol/versions/v1_8_9.rs index 6dc9682..c645c45 100644 --- a/src/protocol/versions/v1_8_9.rs +++ b/src/protocol/versions/v1_8_9.rs @@ -98,7 +98,7 @@ protocol_packet_ids!( 0x3b => ScoreboardObjective 0x3c => UpdateScore 0x3d => ScoreboardDisplay - 0x3e => Teams + 0x3e => Teams_u8 0x3f => PluginMessageClientbound 0x40 => Disconnect 0x41 => ServerDifficulty diff --git a/src/protocol/versions/v1_9.rs b/src/protocol/versions/v1_9.rs index 9ce2b03..c22d778 100644 --- a/src/protocol/versions/v1_9.rs +++ b/src/protocol/versions/v1_9.rs @@ -105,7 +105,7 @@ protocol_packet_ids!( 0x3e => UpdateHealth 0x3f => ScoreboardObjective 0x40 => SetPassengers - 0x41 => Teams + 0x41 => Teams_u8 0x42 => UpdateScore 0x43 => SpawnPosition 0x44 => TimeUpdate diff --git a/src/protocol/versions/v1_9_2.rs b/src/protocol/versions/v1_9_2.rs index 4aec3d0..d6e0b81 100644 --- a/src/protocol/versions/v1_9_2.rs +++ b/src/protocol/versions/v1_9_2.rs @@ -105,7 +105,7 @@ protocol_packet_ids!( 0x3e => UpdateHealth 0x3f => ScoreboardObjective 0x40 => SetPassengers - 0x41 => Teams + 0x41 => Teams_u8 0x42 => UpdateScore 0x43 => SpawnPosition 0x44 => TimeUpdate