From cfcc7d2a1feb4d53f972a4de14942c5fc63af231 Mon Sep 17 00:00:00 2001 From: iceiix <43691553+iceiix@users.noreply.github.com> Date: Sun, 5 Sep 2021 13:30:32 -0700 Subject: [PATCH] 1.17.1 (756) protocol (#605) https://wiki.vg/index.php?title=Protocol&oldid=16918 New and changed packets: * 1.17.1 packet id shifts, new clientbound packets * Add WindowPong new packet serverbound * Add Tags_Nested packet variant * Add TeleportPlayer_WithDismount packet variant * Add ChunkData_Biomes3D_Bitmasks packet variant * Add WindowItems_StateCarry variant, split WindowItems_i16 * Add WindowSetSlot_State packet variant * Add Explosion_VarInt packet variant * Add UpdateLight_Arrays variant * Add ResourcePackSend_Prompt variant * Add SpawnPosition_Angle variant * Add EntityProperties_VarIntVarInt variant, using VarInts in both fields * Add ClientSettings_Filtering variant * Add ClickWindow_State variant * Add EditBook packet variant * Fix many Particle packet variant definitions * server: handle TeleportPlayer_WithDismount * server: handle ChunkData_Biomes3D_Bitmasks * world: add num_sections to self.load_chunk19_or_115 * world: load_chunk19_to_117: accept 64-bit mask * metadata: add PoseData::LongJumping * protocol: update Cargo.lock for serde_json 1.0.130 * build: pin to wasm-pack 0.10.0 --- .github/workflows/build.yaml | 2 +- README.md | 1 + protocol/Cargo.lock | 4 +- protocol/src/protocol/mod.rs | 6 +- protocol/src/protocol/packet.rs | 280 +++++++++++++++++++--- protocol/src/protocol/versions.rs | 3 + protocol/src/protocol/versions/v15w39c.rs | 8 +- protocol/src/protocol/versions/v18w50a.rs | 14 +- protocol/src/protocol/versions/v19w02a.rs | 14 +- protocol/src/protocol/versions/v1_10_2.rs | 8 +- protocol/src/protocol/versions/v1_11_2.rs | 8 +- protocol/src/protocol/versions/v1_12_2.rs | 8 +- protocol/src/protocol/versions/v1_13_2.rs | 12 +- protocol/src/protocol/versions/v1_14.rs | 14 +- protocol/src/protocol/versions/v1_14_1.rs | 14 +- protocol/src/protocol/versions/v1_14_2.rs | 14 +- protocol/src/protocol/versions/v1_14_3.rs | 14 +- protocol/src/protocol/versions/v1_14_4.rs | 14 +- protocol/src/protocol/versions/v1_15.rs | 12 +- protocol/src/protocol/versions/v1_16_1.rs | 12 +- protocol/src/protocol/versions/v1_16_4.rs | 12 +- protocol/src/protocol/versions/v1_17_1.rs | 190 +++++++++++++++ protocol/src/protocol/versions/v1_7_10.rs | 4 +- protocol/src/protocol/versions/v1_8_9.rs | 8 +- protocol/src/protocol/versions/v1_9.rs | 8 +- protocol/src/protocol/versions/v1_9_2.rs | 8 +- protocol/src/types/metadata.rs | 2 + src/server/mod.rs | 34 +++ src/world/mod.rs | 35 ++- 29 files changed, 606 insertions(+), 157 deletions(-) create mode 100644 protocol/src/protocol/versions/v1_17_1.rs diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 8c0bab5..ecc8c8f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -134,7 +134,7 @@ jobs: - name: Install wasm-pack uses: jetli/wasm-pack-action@v0.3.0 with: - version: 'latest' + version: 'v0.10.0' - name: Build binary run: | rustup target add wasm32-unknown-unknown diff --git a/README.md b/README.md index 1152f18..9d99dec 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ Discussion forum: [https://github.com/iceiix/stevenarella/discussions](https://g | Game version | Protocol version | Supported? | | ------ | --- | --- | +| 1.17.1 | 756 | ✓ | | 1.16.5 | 754 | ✓ | | 1.16.4 | 754 | ✓ | | 1.16.3 | 753 | ✓ | diff --git a/protocol/Cargo.lock b/protocol/Cargo.lock index 168a6cb..56f438f 100644 --- a/protocol/Cargo.lock +++ b/protocol/Cargo.lock @@ -778,9 +778,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.127" +version = "1.0.130" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f03b9878abf6d14e6779d3f24f07b2cfa90352cfec4acc5aab8f1ac7f146fae8" +checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913" [[package]] name = "serde_json" diff --git a/protocol/src/protocol/mod.rs b/protocol/src/protocol/mod.rs index b9f1ddc..dfb4266 100644 --- a/protocol/src/protocol/mod.rs +++ b/protocol/src/protocol/mod.rs @@ -39,9 +39,9 @@ use std::io::{Read, Write}; use std::net::TcpStream; use std::sync::atomic::{AtomicBool, AtomicI32, Ordering}; -pub const SUPPORTED_PROTOCOLS: [i32; 24] = [ - 754, 753, 751, 736, 735, 578, 575, 498, 490, 485, 480, 477, 452, 451, 404, 340, 316, 315, 210, - 109, 107, 74, 47, 5, +pub const SUPPORTED_PROTOCOLS: [i32; 25] = [ + 756, 754, 753, 751, 736, 735, 578, 575, 498, 490, 485, 480, 477, 452, 451, 404, 340, 316, 315, + 210, 109, 107, 74, 47, 5, ]; static CURRENT_PROTOCOL_VERSION: AtomicI32 = AtomicI32::new(SUPPORTED_PROTOCOLS[0]); diff --git a/protocol/src/protocol/packet.rs b/protocol/src/protocol/packet.rs index cbffa9f..77c8e7b 100644 --- a/protocol/src/protocol/packet.rs +++ b/protocol/src/protocol/packet.rs @@ -89,6 +89,15 @@ state_packets!( field action_id: u8=, } /// ClientSettings is sent by the client to update its current settings. + packet ClientSettings_Filtering { + field locale: String =, + field view_distance: u8 =, + field chat_mode: VarInt =, + field chat_colors: bool =, + field displayed_skin_parts: u8 =, + field main_hand: VarInt =, + field disable_text_filtering: bool =, + } packet ClientSettings { field locale: String =, field view_distance: u8 =, @@ -137,6 +146,15 @@ state_packets!( field button: u8 =, } /// ClickWindow is sent when the client clicks in a window. + packet ClickWindow_State { + field id: u8 =, + field slot: i16 =, + field state: VarInt =, + field button: u8 =, + field mode: VarInt =, + field slots: LenPrefixed =, + field clicked_item: Option =, + } packet ClickWindow { field id: u8 =, field slot: i16 =, @@ -168,7 +186,12 @@ state_packets!( field channel: String =, field data: LenPrefixedBytes =, } - packet EditBook { + packet EditBook_Pages { + field hand: VarInt =, + field pages: LenPrefixed =, + field title: Option =, + } + packet EditBook_Item { field new_book: Option =, field is_signing: bool =, field hand: VarInt =, @@ -346,6 +369,9 @@ state_packets!( field jump: bool =, field unmount: bool =, } + packet WindowPong { + field id: i32 =, + } /// CraftingBookData is sent when the player interacts with the crafting book. packet CraftingBookData { field action: VarInt =, @@ -777,6 +803,13 @@ state_packets!( field metadata: types::Metadata =, } + packet SculkVibrationSignal { + field source_position: Position =, + field dest_id: String =, + field dest_position: Position = when(|p: &SculkVibrationSignal| p.dest_id == "block"), + field entity_id: VarInt = when(|p: &SculkVibrationSignal| p.dest_id == "entity"), + } + /// Animation is sent by the server to play an animation on a specific entity. packet Animation { field entity_id: VarInt =, @@ -890,6 +923,11 @@ state_packets!( packet ServerMessage_NoPosition { field message: format::Component =, } + packet ClearTitles { + field json_data: String =, + field position: u8 =, + field sender: UUID =, + } /// MultiBlockChange is used to update a batch of blocks in a single packet. packet MultiBlockChange_Packed { field chunk_section_pos: u64 =, @@ -935,6 +973,16 @@ state_packets!( field number_of_slots: VarInt =, field entity_id: i32 =, } + packet WorldBorderInit { + field x: f64 =, + field z: f64 =, + field old_diameter: f64 =, + field new_diameter: f64 =, + field speed: VarLong =, + field portal_teleport_boundary: VarInt =, + field warning_blocks: VarInt =, + field warning_time: VarInt =, + } packet WindowOpen_u8 { field id: u8 =, field ty: u8 =, @@ -949,7 +997,13 @@ state_packets!( field title: format::Component =, } /// WindowItems sets every item in a window. - packet WindowItems { + packet WindowItems_StateCarry { + field id: u8 =, + field state_id: VarInt =, + field items: LenPrefixed> =, + field carried_item: Option =, + } + packet WindowItems_i16 { field id: u8 =, field items: LenPrefixed> =, } @@ -961,6 +1015,12 @@ state_packets!( field value: i16 =, } /// WindowSetSlot changes an itemstack in one of the slots in a window. + packet WindowSetSlot_State { + field id: u8 =, + field state_id: VarInt =, + field property: i16 =, + field item: Option =, + } packet WindowSetSlot { field id: u8 =, field property: i16 =, @@ -1021,7 +1081,17 @@ state_packets!( } /// Explosion is sent when an explosion is triggered (tnt, creeper etc). /// This plays the effect and removes the effected blocks. - packet Explosion { + packet Explosion_VarInt { + field x: f32 =, + field y: f32 =, + field z: f32 =, + field radius: f32 =, + field records: LenPrefixed =, + field velocity_x: f32 =, + field velocity_y: f32 =, + field velocity_z: f32 =, + } + packet Explosion_i32 { field x: f32 =, field y: f32 =, field z: f32 =, @@ -1062,6 +1132,15 @@ state_packets!( } /// ChunkData sends or updates a single chunk on the client. If New is set /// then biome data should be sent too. + packet ChunkData_Biomes3D_Bitmasks { + field chunk_x: i32 =, + field chunk_z: i32 =, + field bitmasks: LenPrefixed =, + field heightmaps: Option =, + field biomes: LenPrefixed =, + field data: LenPrefixedBytes =, + field block_entities: LenPrefixed> =, + } packet ChunkData_Biomes3D_VarInt { field chunk_x: i32 =, field chunk_z: i32 =, @@ -1166,21 +1245,31 @@ state_packets!( field particle_id: i32 =, field long_distance: bool =, field x: f64 =, - field y: f64=, + field y: f64 =, field z: f64 =, field offset_x: f32 =, field offset_y: f32 =, field offset_z: f32 =, field speed: f32 =, field count: i32 =, - field block_state: VarInt = when(|p: &Particle_f64| p.particle_id == 3 || p.particle_id == 23), - field red: f32 = when(|p: &Particle_f64| p.particle_id == 14), - field green: f32 = when(|p: &Particle_f64| p.particle_id == 14), - field blue: f32 = when(|p: &Particle_f64| p.particle_id == 14), - field scale: f32 = when(|p: &Particle_f64| p.particle_id == 14), - field item: Option = when(|p: &Particle_f64| p.particle_id == 32), + field block_state: VarInt = when(|p: &Particle_f64| p.particle_id == 4 || p.particle_id == 25), + field red: f32 = when(|p: &Particle_f64| p.particle_id == 15 || p.particle_id == 16), + field green: f32 = when(|p: &Particle_f64| p.particle_id == 15 || p.particle_id == 16), + field blue: f32 = when(|p: &Particle_f64| p.particle_id == 15 || p.particle_id == 16), + field scale: f32 = when(|p: &Particle_f64| p.particle_id == 15 || p.particle_id == 16), + field to_red: f32 = when(|p: &Particle_f64| p.particle_id == 16), + field to_green: f32 = when(|p: &Particle_f64| p.particle_id == 16), + field to_blue: f32 = when(|p: &Particle_f64| p.particle_id == 16), + field item: Option = when(|p: &Particle_f64| p.particle_id == 36), + field origin_x: f64 = when(|p: &Particle_f64| p.particle_id == 37), + field origin_y: f64 = when(|p: &Particle_f64| p.particle_id == 37), + field origin_z: f64 = when(|p: &Particle_f64| p.particle_id == 37), + field dest_x: f64 = when(|p: &Particle_f64| p.particle_id == 37), + field dest_y: f64 = when(|p: &Particle_f64| p.particle_id == 37), + field dest_z: f64 = when(|p: &Particle_f64| p.particle_id == 37), + field ticks: f64 = when(|p: &Particle_f64| p.particle_id == 37), } - packet Particle_Data { + packet Particle_f32 { field particle_id: i32 =, field long_distance: bool =, field x: f32 =, @@ -1191,30 +1280,22 @@ state_packets!( field offset_z: f32 =, field speed: f32 =, field count: i32 =, - field block_state: VarInt = when(|p: &Particle_Data| p.particle_id == 3 || p.particle_id == 23), - field red: f32 = when(|p: &Particle_Data| p.particle_id == 14), - field green: f32 = when(|p: &Particle_Data| p.particle_id == 14), - field blue: f32 = when(|p: &Particle_Data| p.particle_id == 14), - field scale: f32 = when(|p: &Particle_Data| p.particle_id == 14), - field item: Option = when(|p: &Particle_Data| p.particle_id == 32), - } - packet Particle_Data13 { - field particle_id: i32 =, - field long_distance: bool =, - field x: f32 =, - field y: f32 =, - field z: f32 =, - field offset_x: f32 =, - field offset_y: f32 =, - field offset_z: f32 =, - field speed: f32 =, - field count: i32 =, - field block_state: VarInt = when(|p: &Particle_Data13| p.particle_id == 3 || p.particle_id == 20), - field red: f32 = when(|p: &Particle_Data13| p.particle_id == 11), - field green: f32 = when(|p: &Particle_Data13| p.particle_id == 11), - field blue: f32 = when(|p: &Particle_Data13| p.particle_id == 11), - field scale: f32 = when(|p: &Particle_Data13| p.particle_id == 11), - field item: Option = when(|p: &Particle_Data13| p.particle_id == 27), + field block_state: VarInt = when(|p: &Particle_f32| p.particle_id == 4 || p.particle_id == 25), + field red: f32 = when(|p: &Particle_f32| p.particle_id == 15 || p.particle_id == 16), + field green: f32 = when(|p: &Particle_f32| p.particle_id == 15 || p.particle_id == 16), + field blue: f32 = when(|p: &Particle_f32| p.particle_id == 15 || p.particle_id == 16), + field scale: f32 = when(|p: &Particle_f32| p.particle_id == 15 || p.particle_id == 16), + field to_red: f32 = when(|p: &Particle_f32| p.particle_id == 16), + field to_green: f32 = when(|p: &Particle_f32| p.particle_id == 16), + field to_blue: f32 = when(|p: &Particle_f32| p.particle_id == 16), + field item: Option = when(|p: &Particle_f32| p.particle_id == 36), + field origin_x: f64 = when(|p: &Particle_f32| p.particle_id == 37), + field origin_y: f64 = when(|p: &Particle_f32| p.particle_id == 37), + field origin_z: f64 = when(|p: &Particle_f32| p.particle_id == 37), + field dest_x: f64 = when(|p: &Particle_f32| p.particle_id == 37), + field dest_y: f64 = when(|p: &Particle_f32| p.particle_id == 37), + field dest_z: f64 = when(|p: &Particle_f32| p.particle_id == 37), + field ticks: f64 = when(|p: &Particle_f32| p.particle_id == 37), } packet Particle_VarIntArray { field particle_id: i32 =, @@ -1519,6 +1600,9 @@ state_packets!( field y: i32 =, field z: i32 =, } + packet WindowPing { + field id: i32 =, + } /// CraftRecipeResponse is a response to CraftRecipeRequest, notifies the UI. packet CraftRecipeResponse { field window_id: u8 =, @@ -1540,6 +1624,18 @@ state_packets!( field entity_id: Option = when(|p: &CombatEvent| p.event.0 == 1 || p.event.0 == 2), field message: Option = when(|p: &CombatEvent| p.event.0 == 2), } + packet CombatEventEnd { + field duration: VarInt =, + field entity_id: i32 =, + } + packet CombatEventEnter { + field empty: Vec =, // empty packet, but a field is syntactically required here + } + packet CombatEventDeath { + field player_id: VarInt =, + field entity_id: i32 =, + field message: String =, + } /// PlayerInfo is sent by the server for every player connected to the server /// to provide skin and username information as well as ping and gamemode info. packet PlayerInfo { @@ -1562,6 +1658,16 @@ state_packets!( /// TeleportPlayer is sent to change the player's position. The client is expected /// to reply to the server with the same positions as contained in this packet /// otherwise will reject future packets. + packet TeleportPlayer_WithDismount { + field x: f64 =, + field y: f64 =, + field z: f64 =, + field yaw: f32 =, + field pitch: f32 =, + field flags: u8 =, + field teleport_id: VarInt =, + field dismount: bool =, + } packet TeleportPlayer_WithConfirm { field x: f64 =, field y: f64 =, @@ -1646,6 +1752,13 @@ state_packets!( /// ResourcePackSend causes the client to check its cache for the requested /// resource packet and download it if its missing. Once the resource pack /// is obtained the client will use it. + packet ResourcePackSend_Prompt { + field url: String =, + field hash: String =, + field forced: bool =, + field has_prompt_message: bool =, + field prompt_message: String = when(|p: &ResourcePackSend_Prompt| p.has_prompt_message), + } packet ResourcePackSend { field url: String =, field hash: String =, @@ -1706,6 +1819,9 @@ state_packets!( field has_id: bool =, field tab_id: String = when(|p: &SelectAdvancementTab| p.has_id), } + packet ActionBar { + field text: String =, + } /// WorldBorder configures the world's border. packet WorldBorder { field action: VarInt =, @@ -1718,6 +1834,24 @@ state_packets!( field warning_time: Option = when(|p: &WorldBorder| p.action.0 == 3 || p.action.0 == 4), field warning_blocks: Option = when(|p: &WorldBorder| p.action.0 == 3 || p.action.0 == 5), } + packet WorldBorderCenter { + field x: f64 =, + field z: f64 =, + } + packet WorldBorderLerpSize { + field old_diameter: f64 =, + field new_diameter: f64 =, + field speed: VarLong =, + } + packet WorldBorderSize { + field diameter: f64 =, + } + packet WorldBorderWarningDelay { + field warning_time: VarInt =, + } + packet WorldBorderWarningReach { + field warning_blocks: VarInt =, + } /// Camera causes the client to spectate the entity with the passed id. /// Use the player's id to de-spectate. packet Camera { @@ -1887,7 +2021,11 @@ state_packets!( } /// SpawnPosition is sent to change the player's current spawn point. Currently /// only used by the client for the compass. - packet SpawnPosition { + packet SpawnPosition_Angle { + field location: Position =, + field angle: f32 =, + } + packet SpawnPosition_NoAngle { field location: Position =, } packet SpawnPosition_i32 { @@ -1934,6 +2072,14 @@ state_packets!( field fade_stay: Option = when(|p: &Title_notext_component| p.action.0 == 2), field fade_out: Option = when(|p: &Title_notext_component| p.action.0 == 2), } + packet TitleSubtitle { + field subtitle_text: String =, + } + packet TitleTimes { + field fade_in: i32 =, + field stay: i32 =, + field fade_out: i32 =, + } /// UpdateSign sets or changes the text on a sign. packet UpdateSign { field location: Position =, @@ -2037,7 +2183,11 @@ state_packets!( */ } /// EntityProperties updates the properties for an entity. - packet EntityProperties { + packet EntityProperties_VarIntVarInt { + field entity_id: VarInt =, + field properties: LenPrefixed =, + } + packet EntityProperties_VarInt { field entity_id: VarInt =, field properties: LenPrefixed =, } @@ -2067,18 +2217,32 @@ state_packets!( field item_tags: LenPrefixed =, field fluid_tags: LenPrefixed =, } - packet TagsWithEntities { + packet Tags_WithEntities { field block_tags: LenPrefixed =, field item_tags: LenPrefixed =, field fluid_tags: LenPrefixed =, field entity_tags: LenPrefixed =, } + packet Tags_Nested { + field tags: LenPrefixed =, + } packet AcknowledgePlayerDigging { field location: Position =, field block: VarInt =, field status: VarInt =, field successful: bool =, } + packet UpdateLight_Arrays { + field chunk_x: VarInt =, + field chunk_z: VarInt =, + field trust_edges: bool =, + field sky_light_mask: LenPrefixed =, + field block_light_mask: LenPrefixed =, + field empty_sky_light_mask: LenPrefixed =, + field empty_block_light_mask: LenPrefixed =, + field sky_light_arrays: LenPrefixed> =, + field block_light_arrays: LenPrefixed> =, + } packet UpdateLight_WithTrust { field chunk_x: VarInt =, field chunk_z: VarInt =, @@ -2086,6 +2250,7 @@ state_packets!( field sky_light_mask: VarInt =, field block_light_mask: VarInt =, field empty_sky_light_mask: VarInt =, + // TODO: this packet changed <=1.16.4, see https://wiki.vg/index.php?title=Protocol&oldid=16681#Update_Light field light_arrays: Vec =, } packet UpdateLight_NoTrust { @@ -3007,6 +3172,25 @@ impl Serializable for Tags { } } +#[derive(Debug, Default)] +pub struct TagsGroup { + pub tag_type: String, + pub tags: LenPrefixed, +} + +impl Serializable for TagsGroup { + fn read_from(buf: &mut R) -> Result { + Ok(TagsGroup { + tag_type: Serializable::read_from(buf)?, + tags: Serializable::read_from(buf)?, + }) + } + + fn write_to(&self, _: &mut W) -> Result<(), Error> { + unimplemented!() + } +} + #[derive(Debug, Default)] pub struct Trade { pub input_item_1: Option, @@ -3299,3 +3483,23 @@ impl Serializable for CommandNode { unimplemented!() } } + +#[derive(Debug, Clone, Default)] +pub struct NumberedSlot { + pub slot_number: i16, + pub slot_data: Option, +} + +impl Serializable for NumberedSlot { + fn read_from(buf: &mut R) -> Result { + Ok(NumberedSlot { + slot_number: Serializable::read_from(buf)?, + slot_data: Serializable::read_from(buf)?, + }) + } + + fn write_to(&self, buf: &mut W) -> Result<(), Error> { + self.slot_number.write_to(buf)?; + self.slot_data.write_to(buf) + } +} diff --git a/protocol/src/protocol/versions.rs b/protocol/src/protocol/versions.rs index 0ac05c1..016b607 100644 --- a/protocol/src/protocol/versions.rs +++ b/protocol/src/protocol/versions.rs @@ -15,6 +15,7 @@ mod v1_14_4; mod v1_15; mod v1_16_1; mod v1_16_4; +mod v1_17_1; mod v1_7_10; mod v1_8_9; mod v1_9; @@ -26,6 +27,7 @@ mod v1_9_2; pub fn protocol_name_to_protocol_version(s: String) -> i32 { match s.as_ref() { "" => SUPPORTED_PROTOCOLS[0], + "1.17.1" => 756, "1.16.5" => 754, "1.16.4" => 754, "1.16.3" => 753, @@ -69,6 +71,7 @@ pub fn translate_internal_packet_id_for_version( to_internal: bool, ) -> i32 { match version { + 756 => v1_17_1::translate_internal_packet_id(state, dir, id, to_internal), 754 | 753 | 751 => v1_16_4::translate_internal_packet_id(state, dir, id, to_internal), 736 => v1_16_1::translate_internal_packet_id(state, dir, id, to_internal), 735 => v1_16_1::translate_internal_packet_id(state, dir, id, to_internal), diff --git a/protocol/src/protocol/versions/v15w39c.rs b/protocol/src/protocol/versions/v15w39c.rs index 5c31eff..a822dc5 100644 --- a/protocol/src/protocol/versions/v15w39c.rs +++ b/protocol/src/protocol/versions/v15w39c.rs @@ -57,14 +57,14 @@ protocol_packet_ids!( 0x11 => ConfirmTransaction 0x12 => WindowClose 0x13 => WindowOpen - 0x14 => WindowItems + 0x14 => WindowItems_i16 0x15 => WindowProperty 0x16 => WindowSetSlot 0x17 => SetCooldown 0x18 => PluginMessageClientbound 0x19 => Disconnect 0x1a => EntityAction - 0x1b => Explosion + 0x1b => Explosion_i32 0x1c => ChunkUnload 0x1d => SetCompression 0x1e => ChangeGameState @@ -103,14 +103,14 @@ protocol_packet_ids!( 0x3f => ScoreboardObjective 0x40 => Teams_u8 0x41 => UpdateScore - 0x42 => SpawnPosition + 0x42 => SpawnPosition_NoAngle 0x43 => TimeUpdate 0x44 => Title_notext_component 0x45 => UpdateSign 0x46 => PlayerListHeaderFooter 0x47 => CollectItem_nocount 0x48 => EntityTeleport_i32 - 0x49 => EntityProperties + 0x49 => EntityProperties_VarInt 0x4a => EntityEffect } } diff --git a/protocol/src/protocol/versions/v18w50a.rs b/protocol/src/protocol/versions/v18w50a.rs index f42ee04..fbdc186 100644 --- a/protocol/src/protocol/versions/v18w50a.rs +++ b/protocol/src/protocol/versions/v18w50a.rs @@ -19,7 +19,7 @@ protocol_packet_ids!( 0x08 => ClickWindow 0x09 => CloseWindow 0x0a => PluginMessageServerbound - 0x0b => EditBook + 0x0b => EditBook_Item 0x0c => QueryEntityNBT 0x0d => UseEntity_Hand 0x0e => KeepAliveServerbound_i64 @@ -74,7 +74,7 @@ protocol_packet_ids!( 0x12 => ConfirmTransaction 0x13 => WindowClose 0x14 => WindowOpen - 0x15 => WindowItems + 0x15 => WindowItems_i16 0x16 => WindowProperty 0x17 => WindowSetSlot 0x18 => SetCooldown @@ -83,13 +83,13 @@ protocol_packet_ids!( 0x1b => Disconnect 0x1c => EntityAction 0x1d => NBTQueryResponse - 0x1e => Explosion + 0x1e => Explosion_i32 0x1f => ChunkUnload 0x20 => ChangeGameState 0x21 => KeepAliveClientbound_i64 0x22 => ChunkData_HeightMap 0x23 => Effect - 0x24 => Particle_VarIntArray + 0x24 => Particle_f32 0x25 => JoinGame_i32 0x26 => Maps_NoLocked 0x27 => Entity @@ -127,7 +127,7 @@ protocol_packet_ids!( 0x47 => SetPassengers 0x48 => Teams_u8 0x49 => UpdateScore - 0x4a => SpawnPosition + 0x4a => SpawnPosition_NoAngle 0x4b => TimeUpdate 0x4d => StopSound 0x4e => SoundEffect @@ -136,10 +136,10 @@ protocol_packet_ids!( 0x51 => CollectItem 0x52 => EntityTeleport_f64 0x53 => Advancements - 0x54 => EntityProperties + 0x54 => EntityProperties_VarInt 0x55 => EntityEffect 0x56 => DeclareRecipes - 0x57 => TagsWithEntities + 0x57 => Tags_WithEntities 0x58 => UpdateLight_NoTrust } } diff --git a/protocol/src/protocol/versions/v19w02a.rs b/protocol/src/protocol/versions/v19w02a.rs index e78ad3c..b63cff4 100644 --- a/protocol/src/protocol/versions/v19w02a.rs +++ b/protocol/src/protocol/versions/v19w02a.rs @@ -19,7 +19,7 @@ protocol_packet_ids!( 0x08 => ClickWindow 0x09 => CloseWindow 0x0a => PluginMessageServerbound - 0x0b => EditBook + 0x0b => EditBook_Item 0x0c => QueryEntityNBT 0x0d => UseEntity_Hand 0x0e => KeepAliveServerbound_i64 @@ -74,7 +74,7 @@ protocol_packet_ids!( 0x12 => ConfirmTransaction 0x13 => WindowClose 0x14 => WindowOpenHorse - 0x15 => WindowItems + 0x15 => WindowItems_i16 0x16 => WindowProperty 0x17 => WindowSetSlot 0x18 => SetCooldown @@ -83,13 +83,13 @@ protocol_packet_ids!( 0x1b => Disconnect 0x1c => EntityAction 0x1d => NBTQueryResponse - 0x1e => Explosion + 0x1e => Explosion_i32 0x1f => ChunkUnload 0x20 => ChangeGameState 0x21 => KeepAliveClientbound_i64 0x22 => ChunkData_HeightMap 0x23 => Effect - 0x24 => Particle_Data13 + 0x24 => Particle_f32 0x25 => JoinGame_i32 0x26 => Maps 0x27 => Entity @@ -127,7 +127,7 @@ protocol_packet_ids!( 0x47 => SetPassengers 0x48 => Teams_u8 0x49 => UpdateScore - 0x4a => SpawnPosition + 0x4a => SpawnPosition_NoAngle 0x4b => TimeUpdate 0x4d => StopSound 0x4e => SoundEffect @@ -136,10 +136,10 @@ protocol_packet_ids!( 0x51 => CollectItem 0x52 => EntityTeleport_f64 0x53 => Advancements - 0x54 => EntityProperties + 0x54 => EntityProperties_VarInt 0x55 => EntityEffect 0x56 => DeclareRecipes - 0x57 => TagsWithEntities + 0x57 => Tags_WithEntities 0x58 => UpdateLight_NoTrust 0x59 => WindowOpen_VarInt 0x5a => TradeList_WithoutRestock // TODO: without 1.14 added fields diff --git a/protocol/src/protocol/versions/v1_10_2.rs b/protocol/src/protocol/versions/v1_10_2.rs index 37b4a75..82169db 100644 --- a/protocol/src/protocol/versions/v1_10_2.rs +++ b/protocol/src/protocol/versions/v1_10_2.rs @@ -60,7 +60,7 @@ protocol_packet_ids!( 0x11 => ConfirmTransaction 0x12 => WindowClose 0x13 => WindowOpen - 0x14 => WindowItems + 0x14 => WindowItems_i16 0x15 => WindowProperty 0x16 => WindowSetSlot 0x17 => SetCooldown @@ -68,7 +68,7 @@ protocol_packet_ids!( 0x19 => NamedSoundEffect 0x1a => Disconnect 0x1b => EntityAction - 0x1c => Explosion + 0x1c => Explosion_i32 0x1d => ChunkUnload 0x1e => ChangeGameState 0x1f => KeepAliveClientbound_VarInt @@ -107,14 +107,14 @@ protocol_packet_ids!( 0x40 => SetPassengers 0x41 => Teams_u8 0x42 => UpdateScore - 0x43 => SpawnPosition + 0x43 => SpawnPosition_NoAngle 0x44 => TimeUpdate 0x45 => Title_notext 0x46 => SoundEffect 0x47 => PlayerListHeaderFooter 0x48 => CollectItem_nocount 0x49 => EntityTeleport_f64 - 0x4a => EntityProperties + 0x4a => EntityProperties_VarInt 0x4b => EntityEffect } } diff --git a/protocol/src/protocol/versions/v1_11_2.rs b/protocol/src/protocol/versions/v1_11_2.rs index 52dbbb5..a2fb19b 100644 --- a/protocol/src/protocol/versions/v1_11_2.rs +++ b/protocol/src/protocol/versions/v1_11_2.rs @@ -60,7 +60,7 @@ protocol_packet_ids!( 0x11 => ConfirmTransaction 0x12 => WindowClose 0x13 => WindowOpen - 0x14 => WindowItems + 0x14 => WindowItems_i16 0x15 => WindowProperty 0x16 => WindowSetSlot 0x17 => SetCooldown @@ -68,7 +68,7 @@ protocol_packet_ids!( 0x19 => NamedSoundEffect 0x1a => Disconnect 0x1b => EntityAction - 0x1c => Explosion + 0x1c => Explosion_i32 0x1d => ChunkUnload 0x1e => ChangeGameState 0x1f => KeepAliveClientbound_VarInt @@ -107,14 +107,14 @@ protocol_packet_ids!( 0x40 => SetPassengers 0x41 => Teams_u8 0x42 => UpdateScore - 0x43 => SpawnPosition + 0x43 => SpawnPosition_NoAngle 0x44 => TimeUpdate 0x45 => Title 0x46 => SoundEffect 0x47 => PlayerListHeaderFooter 0x48 => CollectItem 0x49 => EntityTeleport_f64 - 0x4a => EntityProperties + 0x4a => EntityProperties_VarInt 0x4b => EntityEffect } } diff --git a/protocol/src/protocol/versions/v1_12_2.rs b/protocol/src/protocol/versions/v1_12_2.rs index 59cda71..363fe1c 100644 --- a/protocol/src/protocol/versions/v1_12_2.rs +++ b/protocol/src/protocol/versions/v1_12_2.rs @@ -63,7 +63,7 @@ protocol_packet_ids!( 0x11 => ConfirmTransaction 0x12 => WindowClose 0x13 => WindowOpen - 0x14 => WindowItems + 0x14 => WindowItems_i16 0x15 => WindowProperty 0x16 => WindowSetSlot 0x17 => SetCooldown @@ -71,7 +71,7 @@ protocol_packet_ids!( 0x19 => NamedSoundEffect 0x1a => Disconnect 0x1b => EntityAction - 0x1c => Explosion + 0x1c => Explosion_i32 0x1d => ChunkUnload 0x1e => ChangeGameState 0x1f => KeepAliveClientbound_i64 @@ -113,7 +113,7 @@ protocol_packet_ids!( 0x43 => SetPassengers 0x44 => Teams_u8 0x45 => UpdateScore - 0x46 => SpawnPosition + 0x46 => SpawnPosition_NoAngle 0x47 => TimeUpdate 0x48 => Title 0x49 => SoundEffect @@ -121,7 +121,7 @@ protocol_packet_ids!( 0x4b => CollectItem 0x4c => EntityTeleport_f64 0x4d => Advancements - 0x4e => EntityProperties + 0x4e => EntityProperties_VarInt 0x4f => EntityEffect } } diff --git a/protocol/src/protocol/versions/v1_13_2.rs b/protocol/src/protocol/versions/v1_13_2.rs index 0c78c8f..d2cf0b3 100644 --- a/protocol/src/protocol/versions/v1_13_2.rs +++ b/protocol/src/protocol/versions/v1_13_2.rs @@ -19,7 +19,7 @@ protocol_packet_ids!( 0x08 => ClickWindow 0x09 => CloseWindow 0x0a => PluginMessageServerbound - 0x0b => EditBook + 0x0b => EditBook_Item 0x0c => QueryEntityNBT 0x0d => UseEntity_Hand 0x0e => KeepAliveServerbound_i64 @@ -74,7 +74,7 @@ protocol_packet_ids!( 0x12 => ConfirmTransaction 0x13 => WindowClose 0x14 => WindowOpen - 0x15 => WindowItems + 0x15 => WindowItems_i16 0x16 => WindowProperty 0x17 => WindowSetSlot 0x18 => SetCooldown @@ -83,13 +83,13 @@ protocol_packet_ids!( 0x1b => Disconnect 0x1c => EntityAction 0x1d => NBTQueryResponse - 0x1e => Explosion + 0x1e => Explosion_i32 0x1f => ChunkUnload 0x20 => ChangeGameState 0x21 => KeepAliveClientbound_i64 0x22 => ChunkData 0x23 => Effect - 0x24 => Particle_Data13 + 0x24 => Particle_f32 0x25 => JoinGame_i32 0x26 => Maps_NoLocked 0x27 => Entity @@ -126,7 +126,7 @@ protocol_packet_ids!( 0x46 => SetPassengers 0x47 => Teams_VarInt 0x48 => UpdateScore - 0x49 => SpawnPosition + 0x49 => SpawnPosition_NoAngle 0x4a => TimeUpdate 0x4c => StopSound 0x4d => SoundEffect @@ -134,7 +134,7 @@ protocol_packet_ids!( 0x4f => CollectItem 0x50 => EntityTeleport_f64 0x51 => Advancements - 0x52 => EntityProperties + 0x52 => EntityProperties_VarInt 0x53 => EntityEffect 0x54 => DeclareRecipes 0x55 => Tags diff --git a/protocol/src/protocol/versions/v1_14.rs b/protocol/src/protocol/versions/v1_14.rs index 05a19bd..ccf10e6 100644 --- a/protocol/src/protocol/versions/v1_14.rs +++ b/protocol/src/protocol/versions/v1_14.rs @@ -20,7 +20,7 @@ protocol_packet_ids!( 0x09 => ClickWindow 0x0a => CloseWindow 0x0b => PluginMessageServerbound - 0x0c => EditBook + 0x0c => EditBook_Item 0x0d => QueryEntityNBT 0x0e => UseEntity_Hand 0x0f => KeepAliveServerbound_i64 @@ -76,7 +76,7 @@ protocol_packet_ids!( 0x11 => DeclareCommands 0x12 => ConfirmTransaction 0x13 => WindowClose - 0x14 => WindowItems + 0x14 => WindowItems_i16 0x15 => WindowProperty 0x16 => WindowSetSlot 0x17 => SetCooldown @@ -84,14 +84,14 @@ protocol_packet_ids!( 0x19 => NamedSoundEffect 0x1a => Disconnect 0x1b => EntityAction - 0x1c => Explosion + 0x1c => Explosion_i32 0x1d => ChunkUnload 0x1e => ChangeGameState 0x1f => WindowOpenHorse 0x20 => KeepAliveClientbound_i64 0x21 => ChunkData_HeightMap 0x22 => Effect - 0x23 => Particle_Data + 0x23 => Particle_f32 0x24 => UpdateLight_NoTrust 0x25 => JoinGame_i32_ViewDistance 0x26 => Maps @@ -133,7 +133,7 @@ protocol_packet_ids!( 0x4a => SetPassengers 0x4b => Teams_VarInt 0x4c => UpdateScore - 0x4d => SpawnPosition + 0x4d => SpawnPosition_NoAngle 0x4e => TimeUpdate 0x4f => Title 0x50 => EntitySoundEffect @@ -144,10 +144,10 @@ protocol_packet_ids!( 0x55 => CollectItem 0x56 => EntityTeleport_f64 0x57 => Advancements - 0x58 => EntityProperties + 0x58 => EntityProperties_VarInt 0x59 => EntityEffect 0x5a => DeclareRecipes - 0x5b => TagsWithEntities + 0x5b => Tags_WithEntities } } login Login { diff --git a/protocol/src/protocol/versions/v1_14_1.rs b/protocol/src/protocol/versions/v1_14_1.rs index 05a19bd..ccf10e6 100644 --- a/protocol/src/protocol/versions/v1_14_1.rs +++ b/protocol/src/protocol/versions/v1_14_1.rs @@ -20,7 +20,7 @@ protocol_packet_ids!( 0x09 => ClickWindow 0x0a => CloseWindow 0x0b => PluginMessageServerbound - 0x0c => EditBook + 0x0c => EditBook_Item 0x0d => QueryEntityNBT 0x0e => UseEntity_Hand 0x0f => KeepAliveServerbound_i64 @@ -76,7 +76,7 @@ protocol_packet_ids!( 0x11 => DeclareCommands 0x12 => ConfirmTransaction 0x13 => WindowClose - 0x14 => WindowItems + 0x14 => WindowItems_i16 0x15 => WindowProperty 0x16 => WindowSetSlot 0x17 => SetCooldown @@ -84,14 +84,14 @@ protocol_packet_ids!( 0x19 => NamedSoundEffect 0x1a => Disconnect 0x1b => EntityAction - 0x1c => Explosion + 0x1c => Explosion_i32 0x1d => ChunkUnload 0x1e => ChangeGameState 0x1f => WindowOpenHorse 0x20 => KeepAliveClientbound_i64 0x21 => ChunkData_HeightMap 0x22 => Effect - 0x23 => Particle_Data + 0x23 => Particle_f32 0x24 => UpdateLight_NoTrust 0x25 => JoinGame_i32_ViewDistance 0x26 => Maps @@ -133,7 +133,7 @@ protocol_packet_ids!( 0x4a => SetPassengers 0x4b => Teams_VarInt 0x4c => UpdateScore - 0x4d => SpawnPosition + 0x4d => SpawnPosition_NoAngle 0x4e => TimeUpdate 0x4f => Title 0x50 => EntitySoundEffect @@ -144,10 +144,10 @@ protocol_packet_ids!( 0x55 => CollectItem 0x56 => EntityTeleport_f64 0x57 => Advancements - 0x58 => EntityProperties + 0x58 => EntityProperties_VarInt 0x59 => EntityEffect 0x5a => DeclareRecipes - 0x5b => TagsWithEntities + 0x5b => Tags_WithEntities } } login Login { diff --git a/protocol/src/protocol/versions/v1_14_2.rs b/protocol/src/protocol/versions/v1_14_2.rs index 05a19bd..ccf10e6 100644 --- a/protocol/src/protocol/versions/v1_14_2.rs +++ b/protocol/src/protocol/versions/v1_14_2.rs @@ -20,7 +20,7 @@ protocol_packet_ids!( 0x09 => ClickWindow 0x0a => CloseWindow 0x0b => PluginMessageServerbound - 0x0c => EditBook + 0x0c => EditBook_Item 0x0d => QueryEntityNBT 0x0e => UseEntity_Hand 0x0f => KeepAliveServerbound_i64 @@ -76,7 +76,7 @@ protocol_packet_ids!( 0x11 => DeclareCommands 0x12 => ConfirmTransaction 0x13 => WindowClose - 0x14 => WindowItems + 0x14 => WindowItems_i16 0x15 => WindowProperty 0x16 => WindowSetSlot 0x17 => SetCooldown @@ -84,14 +84,14 @@ protocol_packet_ids!( 0x19 => NamedSoundEffect 0x1a => Disconnect 0x1b => EntityAction - 0x1c => Explosion + 0x1c => Explosion_i32 0x1d => ChunkUnload 0x1e => ChangeGameState 0x1f => WindowOpenHorse 0x20 => KeepAliveClientbound_i64 0x21 => ChunkData_HeightMap 0x22 => Effect - 0x23 => Particle_Data + 0x23 => Particle_f32 0x24 => UpdateLight_NoTrust 0x25 => JoinGame_i32_ViewDistance 0x26 => Maps @@ -133,7 +133,7 @@ protocol_packet_ids!( 0x4a => SetPassengers 0x4b => Teams_VarInt 0x4c => UpdateScore - 0x4d => SpawnPosition + 0x4d => SpawnPosition_NoAngle 0x4e => TimeUpdate 0x4f => Title 0x50 => EntitySoundEffect @@ -144,10 +144,10 @@ protocol_packet_ids!( 0x55 => CollectItem 0x56 => EntityTeleport_f64 0x57 => Advancements - 0x58 => EntityProperties + 0x58 => EntityProperties_VarInt 0x59 => EntityEffect 0x5a => DeclareRecipes - 0x5b => TagsWithEntities + 0x5b => Tags_WithEntities } } login Login { diff --git a/protocol/src/protocol/versions/v1_14_3.rs b/protocol/src/protocol/versions/v1_14_3.rs index 1aa8d92..ed92aa7 100644 --- a/protocol/src/protocol/versions/v1_14_3.rs +++ b/protocol/src/protocol/versions/v1_14_3.rs @@ -20,7 +20,7 @@ protocol_packet_ids!( 0x09 => ClickWindow 0x0a => CloseWindow 0x0b => PluginMessageServerbound - 0x0c => EditBook + 0x0c => EditBook_Item 0x0d => QueryEntityNBT 0x0e => UseEntity_Hand 0x0f => KeepAliveServerbound_i64 @@ -76,7 +76,7 @@ protocol_packet_ids!( 0x11 => DeclareCommands 0x12 => ConfirmTransaction 0x13 => WindowClose - 0x14 => WindowItems + 0x14 => WindowItems_i16 0x15 => WindowProperty 0x16 => WindowSetSlot 0x17 => SetCooldown @@ -84,14 +84,14 @@ protocol_packet_ids!( 0x19 => NamedSoundEffect 0x1a => Disconnect 0x1b => EntityAction - 0x1c => Explosion + 0x1c => Explosion_i32 0x1d => ChunkUnload 0x1e => ChangeGameState 0x1f => WindowOpenHorse 0x20 => KeepAliveClientbound_i64 0x21 => ChunkData_HeightMap 0x22 => Effect - 0x23 => Particle_Data + 0x23 => Particle_f32 0x24 => UpdateLight_NoTrust 0x25 => JoinGame_i32_ViewDistance 0x26 => Maps @@ -133,7 +133,7 @@ protocol_packet_ids!( 0x4a => SetPassengers 0x4b => Teams_VarInt 0x4c => UpdateScore - 0x4d => SpawnPosition + 0x4d => SpawnPosition_NoAngle 0x4e => TimeUpdate 0x4f => Title 0x50 => EntitySoundEffect @@ -144,10 +144,10 @@ protocol_packet_ids!( 0x55 => CollectItem 0x56 => EntityTeleport_f64 0x57 => Advancements - 0x58 => EntityProperties + 0x58 => EntityProperties_VarInt 0x59 => EntityEffect 0x5a => DeclareRecipes - 0x5b => TagsWithEntities + 0x5b => Tags_WithEntities } } login Login { diff --git a/protocol/src/protocol/versions/v1_14_4.rs b/protocol/src/protocol/versions/v1_14_4.rs index f518c4c..f74d5ee 100644 --- a/protocol/src/protocol/versions/v1_14_4.rs +++ b/protocol/src/protocol/versions/v1_14_4.rs @@ -20,7 +20,7 @@ protocol_packet_ids!( 0x09 => ClickWindow 0x0a => CloseWindow 0x0b => PluginMessageServerbound - 0x0c => EditBook + 0x0c => EditBook_Item 0x0d => QueryEntityNBT 0x0e => UseEntity_Hand 0x0f => KeepAliveServerbound_i64 @@ -76,7 +76,7 @@ protocol_packet_ids!( 0x11 => DeclareCommands 0x12 => ConfirmTransaction 0x13 => WindowClose - 0x14 => WindowItems + 0x14 => WindowItems_i16 0x15 => WindowProperty 0x16 => WindowSetSlot 0x17 => SetCooldown @@ -84,14 +84,14 @@ protocol_packet_ids!( 0x19 => NamedSoundEffect 0x1a => Disconnect 0x1b => EntityAction - 0x1c => Explosion + 0x1c => Explosion_i32 0x1d => ChunkUnload 0x1e => ChangeGameState 0x1f => WindowOpenHorse 0x20 => KeepAliveClientbound_i64 0x21 => ChunkData_HeightMap 0x22 => Effect - 0x23 => Particle_Data + 0x23 => Particle_f32 0x24 => UpdateLight_NoTrust 0x25 => JoinGame_i32_ViewDistance 0x26 => Maps @@ -133,7 +133,7 @@ protocol_packet_ids!( 0x4a => SetPassengers 0x4b => Teams_VarInt 0x4c => UpdateScore - 0x4d => SpawnPosition + 0x4d => SpawnPosition_NoAngle 0x4e => TimeUpdate 0x4f => Title 0x50 => EntitySoundEffect @@ -144,10 +144,10 @@ protocol_packet_ids!( 0x55 => CollectItem 0x56 => EntityTeleport_f64 0x57 => Advancements - 0x58 => EntityProperties + 0x58 => EntityProperties_VarInt 0x59 => EntityEffect 0x5a => DeclareRecipes - 0x5b => TagsWithEntities + 0x5b => Tags_WithEntities 0x5c => AcknowledgePlayerDigging } } diff --git a/protocol/src/protocol/versions/v1_15.rs b/protocol/src/protocol/versions/v1_15.rs index 9ccc921..9e62f9d 100644 --- a/protocol/src/protocol/versions/v1_15.rs +++ b/protocol/src/protocol/versions/v1_15.rs @@ -20,7 +20,7 @@ protocol_packet_ids!( 0x09 => ClickWindow 0x0a => CloseWindow 0x0b => PluginMessageServerbound - 0x0c => EditBook + 0x0c => EditBook_Item 0x0d => QueryEntityNBT 0x0e => UseEntity_Hand 0x0f => KeepAliveServerbound_i64 @@ -77,7 +77,7 @@ protocol_packet_ids!( 0x12 => DeclareCommands 0x13 => ConfirmTransaction 0x14 => WindowClose - 0x15 => WindowItems + 0x15 => WindowItems_i16 0x16 => WindowProperty 0x17 => WindowSetSlot 0x18 => SetCooldown @@ -85,7 +85,7 @@ protocol_packet_ids!( 0x1a => NamedSoundEffect 0x1b => Disconnect 0x1c => EntityAction - 0x1d => Explosion + 0x1d => Explosion_i32 0x1e => ChunkUnload 0x1f => ChangeGameState 0x20 => WindowOpenHorse @@ -134,7 +134,7 @@ protocol_packet_ids!( 0x4b => SetPassengers 0x4c => Teams_VarInt 0x4d => UpdateScore - 0x4e => SpawnPosition + 0x4e => SpawnPosition_NoAngle 0x4f => TimeUpdate 0x50 => Title 0x51 => EntitySoundEffect @@ -145,10 +145,10 @@ protocol_packet_ids!( 0x56 => CollectItem 0x57 => EntityTeleport_f64 0x58 => Advancements - 0x59 => EntityProperties + 0x59 => EntityProperties_VarInt 0x5a => EntityEffect 0x5b => DeclareRecipes - 0x5c => TagsWithEntities + 0x5c => Tags_WithEntities } } login Login { diff --git a/protocol/src/protocol/versions/v1_16_1.rs b/protocol/src/protocol/versions/v1_16_1.rs index 380d39b..a29f785 100644 --- a/protocol/src/protocol/versions/v1_16_1.rs +++ b/protocol/src/protocol/versions/v1_16_1.rs @@ -20,7 +20,7 @@ protocol_packet_ids!( 0x09 => ClickWindow 0x0a => CloseWindow 0x0b => PluginMessageServerbound - 0x0c => EditBook + 0x0c => EditBook_Item 0x0d => QueryEntityNBT 0x0e => UseEntity_Sneakflag 0x0f => GenerateStructure @@ -77,7 +77,7 @@ protocol_packet_ids!( 0x11 => DeclareCommands 0x12 => ConfirmTransaction 0x13 => WindowClose - 0x14 => WindowItems + 0x14 => WindowItems_i16 0x15 => WindowProperty 0x16 => WindowSetSlot 0x17 => SetCooldown @@ -85,7 +85,7 @@ protocol_packet_ids!( 0x19 => NamedSoundEffect 0x1a => Disconnect 0x1b => EntityAction - 0x1c => Explosion + 0x1c => Explosion_i32 0x1d => ChunkUnload 0x1e => ChangeGameState 0x1f => WindowOpenHorse @@ -123,7 +123,7 @@ protocol_packet_ids!( 0x3f => SetCurrentHotbarSlot 0x40 => UpdateViewPosition 0x41 => UpdateViewDistance - 0x42 => SpawnPosition + 0x42 => SpawnPosition_NoAngle 0x43 => ScoreboardDisplay 0x44 => EntityMetadata 0x45 => EntityAttach @@ -145,10 +145,10 @@ protocol_packet_ids!( 0x55 => CollectItem 0x56 => EntityTeleport_f64 0x57 => Advancements - 0x58 => EntityProperties + 0x58 => EntityProperties_VarInt 0x59 => EntityEffect 0x5a => DeclareRecipes - 0x5b => TagsWithEntities + 0x5b => Tags_WithEntities } } login Login { diff --git a/protocol/src/protocol/versions/v1_16_4.rs b/protocol/src/protocol/versions/v1_16_4.rs index 8a9cd66..0a47fd7 100644 --- a/protocol/src/protocol/versions/v1_16_4.rs +++ b/protocol/src/protocol/versions/v1_16_4.rs @@ -20,7 +20,7 @@ protocol_packet_ids!( 0x09 => ClickWindow 0x0a => CloseWindow 0x0b => PluginMessageServerbound - 0x0c => EditBook + 0x0c => EditBook_Item 0x0d => QueryEntityNBT 0x0e => UseEntity_Sneakflag 0x0f => GenerateStructure @@ -77,7 +77,7 @@ protocol_packet_ids!( 0x10 => DeclareCommands 0x11 => ConfirmTransaction 0x12 => WindowClose - 0x13 => WindowItems + 0x13 => WindowItems_i16 0x14 => WindowProperty 0x15 => WindowSetSlot 0x16 => SetCooldown @@ -85,7 +85,7 @@ protocol_packet_ids!( 0x18 => NamedSoundEffect 0x19 => Disconnect 0x1a => EntityAction - 0x1b => Explosion + 0x1b => Explosion_i32 0x1c => ChunkUnload 0x1d => ChangeGameState 0x1e => WindowOpenHorse @@ -124,7 +124,7 @@ protocol_packet_ids!( 0x3f => SetCurrentHotbarSlot 0x40 => UpdateViewPosition 0x41 => UpdateViewDistance - 0x42 => SpawnPosition + 0x42 => SpawnPosition_NoAngle 0x43 => ScoreboardDisplay 0x44 => EntityMetadata 0x45 => EntityAttach @@ -146,10 +146,10 @@ protocol_packet_ids!( 0x55 => CollectItem 0x56 => EntityTeleport_f64 0x57 => Advancements - 0x58 => EntityProperties + 0x58 => EntityProperties_VarInt 0x59 => EntityEffect 0x5a => DeclareRecipes - 0x5b => TagsWithEntities + 0x5b => Tags_WithEntities } } login Login { diff --git a/protocol/src/protocol/versions/v1_17_1.rs b/protocol/src/protocol/versions/v1_17_1.rs new file mode 100644 index 0000000..837b596 --- /dev/null +++ b/protocol/src/protocol/versions/v1_17_1.rs @@ -0,0 +1,190 @@ +protocol_packet_ids!( + handshake Handshaking { + serverbound Serverbound { + 0x00 => Handshake + } + clientbound Clientbound { + } + } + play Play { + serverbound Serverbound { + 0x00 => TeleportConfirm + 0x01 => QueryBlockNBT + 0x02 => SetDifficulty + 0x03 => ChatMessage + 0x04 => ClientStatus + 0x05 => ClientSettings_Filtering + 0x06 => TabComplete + 0x07 => ClickWindowButton + 0x08 => ClickWindow_State + 0x09 => CloseWindow + 0x0a => PluginMessageServerbound + 0x0b => EditBook_Pages + 0x0c => QueryEntityNBT + 0x0d => UseEntity_Sneakflag + 0x0e => GenerateStructure + 0x0f => KeepAliveServerbound_i64 + 0x10 => LockDifficulty + 0x11 => PlayerPosition + 0x12 => PlayerPositionLook + 0x13 => PlayerLook + 0x14 => Player + 0x15 => VehicleMove + 0x16 => SteerBoat + 0x17 => PickItem + 0x18 => CraftRecipeRequest + 0x19 => ClientAbilities_u8 + 0x1a => PlayerDigging + 0x1b => PlayerAction + 0x1c => SteerVehicle + 0x1d => WindowPong + 0x1e => SetDisplayedRecipe + 0x1f => SetRecipeBookState + 0x20 => NameItem + 0x21 => ResourcePackStatus + 0x22 => AdvancementTab + 0x23 => SelectTrade + 0x24 => SetBeaconEffect + 0x25 => HeldItemChange + 0x26 => UpdateCommandBlock + 0x27 => UpdateCommandBlockMinecart + 0x28 => CreativeInventoryAction + 0x29 => UpdateJigsawBlock_Joint + 0x2a => UpdateStructureBlock + 0x2b => SetSign + 0x2c => ArmSwing + 0x2d => SpectateTeleport + 0x2e => PlayerBlockPlacement_insideblock + 0x2f => UseItem + } + clientbound Clientbound { + 0x00 => SpawnObject_VarInt + 0x01 => SpawnExperienceOrb + 0x02 => SpawnMob_NoMeta + 0x03 => SpawnPainting_VarInt + 0x04 => SpawnPlayer_f64_NoMeta + 0x05 => SculkVibrationSignal + 0x06 => Animation + 0x07 => Statistics + 0x08 => AcknowledgePlayerDigging + 0x09 => BlockBreakAnimation + 0x0a => UpdateBlockEntity + 0x0b => BlockAction + 0x0c => BlockChange_VarInt + 0x0d => BossBar + 0x0e => ServerDifficulty_Locked + 0x0f => ServerMessage_Sender + 0x10 => ClearTitles + 0x11 => TabCompleteReply + 0x12 => DeclareCommands + 0x13 => WindowClose + 0x14 => WindowItems_StateCarry + 0x15 => WindowProperty + 0x16 => WindowSetSlot_State + 0x17 => SetCooldown + 0x18 => PluginMessageClientbound + 0x19 => NamedSoundEffect + 0x1a => Disconnect + 0x1b => EntityAction + 0x1c => Explosion_VarInt + 0x1d => ChunkUnload + 0x1e => ChangeGameState + 0x1f => WindowOpenHorse + 0x20 => WorldBorderInit + 0x21 => KeepAliveClientbound_i64 + 0x22 => ChunkData_Biomes3D_Bitmasks + 0x23 => Effect + 0x24 => Particle_f64 + 0x25 => UpdateLight_Arrays + 0x26 => JoinGame_WorldNames_IsHard + 0x27 => Maps + 0x28 => TradeList_WithRestock + 0x29 => EntityMove_i16 + 0x2a => EntityLookAndMove_i16 + 0x2b => EntityLook_VarInt + 0x2c => VehicleTeleport + 0x2d => OpenBook + 0x2e => WindowOpen_VarInt + 0x2f => SignEditorOpen + 0x30 => WindowPing + 0x31 => CraftRecipeResponse + 0x32 => PlayerAbilities + 0x33 => CombatEventEnd + 0x34 => CombatEventEnter + 0x35 => CombatEventDeath + 0x36 => PlayerInfo + 0x37 => FacePlayer + 0x38 => TeleportPlayer_WithDismount + 0x39 => UnlockRecipes_WithBlastSmoker + 0x3a => EntityDestroy + 0x3b => EntityRemoveEffect + 0x3c => ResourcePackSend_Prompt + 0x3d => Respawn_NBT + 0x3e => EntityHeadLook + 0x3f => MultiBlockChange_Packed + 0x40 => SelectAdvancementTab + 0x41 => ActionBar + 0x42 => WorldBorderCenter + 0x43 => WorldBorderLerpSize + 0x44 => WorldBorderSize + 0x45 => WorldBorderWarningDelay + 0x46 => WorldBorderWarningReach + 0x47 => Camera + 0x48 => SetCurrentHotbarSlot + 0x49 => UpdateViewPosition + 0x4a => UpdateViewDistance + 0x4b => SpawnPosition_Angle + 0x4c => ScoreboardDisplay + 0x4d => EntityMetadata + 0x4e => EntityAttach + 0x4f => EntityVelocity + 0x50 => EntityEquipment_Array + 0x51 => SetExperience + 0x52 => UpdateHealth + 0x53 => ScoreboardObjective + 0x54 => SetPassengers + 0x55 => Teams_VarInt + 0x56 => UpdateScore + 0x57 => TitleSubtitle + 0x58 => TimeUpdate + 0x59 => Title + 0x5a => TitleTimes + 0x5b => EntitySoundEffect + 0x5c => SoundEffect + 0x5d => StopSound + 0x5e => PlayerListHeaderFooter + 0x5f => NBTQueryResponse + 0x60 => CollectItem + 0x61 => EntityTeleport_f64 + 0x62 => Advancements + 0x63 => EntityProperties_VarIntVarInt + 0x64 => EntityEffect + 0x65 => DeclareRecipes + 0x66 => Tags_Nested + } + } + login Login { + serverbound Serverbound { + 0x00 => LoginStart + 0x01 => EncryptionResponse + 0x02 => LoginPluginResponse + } + clientbound Clientbound { + 0x00 => LoginDisconnect + 0x01 => EncryptionRequest + 0x02 => LoginSuccess_UUID + 0x03 => SetInitialCompression + 0x04 => LoginPluginRequest + } + } + status Status { + serverbound Serverbound { + 0x00 => StatusRequest + 0x01 => StatusPing + } + clientbound Clientbound { + 0x00 => StatusResponse + 0x01 => StatusPong + } + } +); diff --git a/protocol/src/protocol/versions/v1_7_10.rs b/protocol/src/protocol/versions/v1_7_10.rs index d637f27..09f790d 100644 --- a/protocol/src/protocol/versions/v1_7_10.rs +++ b/protocol/src/protocol/versions/v1_7_10.rs @@ -73,7 +73,7 @@ protocol_packet_ids!( 0x24 => BlockAction_u16 0x25 => BlockBreakAnimation_i32 0x26 => ChunkDataBulk_17 - 0x27 => Explosion + 0x27 => Explosion_i32 0x28 => Effect_u8y 0x29 => NamedSoundEffect_u8_NoCategory 0x2a => Particle_Named @@ -82,7 +82,7 @@ protocol_packet_ids!( 0x2d => WindowOpen_u8 0x2e => WindowClose 0x2f => WindowSetSlot - 0x30 => WindowItems + 0x30 => WindowItems_i16 0x31 => WindowProperty 0x32 => ConfirmTransaction 0x33 => UpdateSign_u16 diff --git a/protocol/src/protocol/versions/v1_8_9.rs b/protocol/src/protocol/versions/v1_8_9.rs index 8b116c5..6cc86f9 100644 --- a/protocol/src/protocol/versions/v1_8_9.rs +++ b/protocol/src/protocol/versions/v1_8_9.rs @@ -41,7 +41,7 @@ protocol_packet_ids!( 0x02 => ServerMessage_Position 0x03 => TimeUpdate 0x04 => EntityEquipment_u16 - 0x05 => SpawnPosition + 0x05 => SpawnPosition_NoAngle 0x06 => UpdateHealth 0x07 => Respawn_Gamemode 0x08 => TeleportPlayer_NoConfirm @@ -68,14 +68,14 @@ protocol_packet_ids!( 0x1d => EntityEffect 0x1e => EntityRemoveEffect 0x1f => SetExperience - 0x20 => EntityProperties + 0x20 => EntityProperties_VarInt 0x21 => ChunkData_NoEntities_u16 0x22 => MultiBlockChange_VarInt 0x23 => BlockChange_VarInt 0x24 => BlockAction 0x25 => BlockBreakAnimation 0x26 => ChunkDataBulk - 0x27 => Explosion + 0x27 => Explosion_i32 0x28 => Effect 0x29 => NamedSoundEffect_u8_NoCategory 0x2a => Particle_VarIntArray @@ -84,7 +84,7 @@ protocol_packet_ids!( 0x2d => WindowOpen 0x2e => WindowClose 0x2f => WindowSetSlot - 0x30 => WindowItems + 0x30 => WindowItems_i16 0x31 => WindowProperty 0x32 => ConfirmTransaction 0x33 => UpdateSign diff --git a/protocol/src/protocol/versions/v1_9.rs b/protocol/src/protocol/versions/v1_9.rs index 0f4f0d1..6f2ebe4 100644 --- a/protocol/src/protocol/versions/v1_9.rs +++ b/protocol/src/protocol/versions/v1_9.rs @@ -60,7 +60,7 @@ protocol_packet_ids!( 0x11 => ConfirmTransaction 0x12 => WindowClose 0x13 => WindowOpen - 0x14 => WindowItems + 0x14 => WindowItems_i16 0x15 => WindowProperty 0x16 => WindowSetSlot 0x17 => SetCooldown @@ -68,7 +68,7 @@ protocol_packet_ids!( 0x19 => NamedSoundEffect_u8 0x1a => Disconnect 0x1b => EntityAction - 0x1c => Explosion + 0x1c => Explosion_i32 0x1d => ChunkUnload 0x1e => ChangeGameState 0x1f => KeepAliveClientbound_VarInt @@ -107,7 +107,7 @@ protocol_packet_ids!( 0x40 => SetPassengers 0x41 => Teams_u8 0x42 => UpdateScore - 0x43 => SpawnPosition + 0x43 => SpawnPosition_NoAngle 0x44 => TimeUpdate 0x45 => Title_notext 0x46 => UpdateSign @@ -115,7 +115,7 @@ protocol_packet_ids!( 0x48 => PlayerListHeaderFooter 0x49 => CollectItem_nocount 0x4a => EntityTeleport_f64 - 0x4b => EntityProperties + 0x4b => EntityProperties_VarInt 0x4c => EntityEffect } } diff --git a/protocol/src/protocol/versions/v1_9_2.rs b/protocol/src/protocol/versions/v1_9_2.rs index d0db82c..05eb1f6 100644 --- a/protocol/src/protocol/versions/v1_9_2.rs +++ b/protocol/src/protocol/versions/v1_9_2.rs @@ -60,7 +60,7 @@ protocol_packet_ids!( 0x11 => ConfirmTransaction 0x12 => WindowClose 0x13 => WindowOpen - 0x14 => WindowItems + 0x14 => WindowItems_i16 0x15 => WindowProperty 0x16 => WindowSetSlot 0x17 => SetCooldown @@ -68,7 +68,7 @@ protocol_packet_ids!( 0x19 => NamedSoundEffect_u8 0x1a => Disconnect 0x1b => EntityAction - 0x1c => Explosion + 0x1c => Explosion_i32 0x1d => ChunkUnload 0x1e => ChangeGameState 0x1f => KeepAliveClientbound_VarInt @@ -107,7 +107,7 @@ protocol_packet_ids!( 0x40 => SetPassengers 0x41 => Teams_u8 0x42 => UpdateScore - 0x43 => SpawnPosition + 0x43 => SpawnPosition_NoAngle 0x44 => TimeUpdate 0x45 => Title_notext 0x46 => UpdateSign @@ -115,7 +115,7 @@ protocol_packet_ids!( 0x48 => PlayerListHeaderFooter 0x49 => CollectItem_nocount 0x4a => EntityTeleport_f64 - 0x4b => EntityProperties + 0x4b => EntityProperties_VarInt 0x4c => EntityEffect } } diff --git a/protocol/src/types/metadata.rs b/protocol/src/types/metadata.rs index 2297d5f..4020418 100644 --- a/protocol/src/types/metadata.rs +++ b/protocol/src/types/metadata.rs @@ -688,6 +688,7 @@ pub enum PoseData { SpinAttack, Sneaking, Dying, + LongJumping, } impl Serializable for PoseData { @@ -701,6 +702,7 @@ impl Serializable for PoseData { 4 => PoseData::SpinAttack, 5 => PoseData::Sneaking, 6 => PoseData::Dying, + 7 => PoseData::LongJumping, _ => panic!("unknown pose data: {}", n.0), }) } diff --git a/src/server/mod.rs b/src/server/mod.rs index b26dcef..1851e9b 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -595,6 +595,7 @@ impl Server { KeepAliveClientbound_i64 => on_keep_alive_i64, KeepAliveClientbound_VarInt => on_keep_alive_varint, KeepAliveClientbound_i32 => on_keep_alive_i32, + ChunkData_Biomes3D_Bitmasks => on_chunk_data_biomes3d_bitmasks, ChunkData_Biomes3D_VarInt => on_chunk_data_biomes3d_varint, ChunkData_Biomes3D_bool => on_chunk_data_biomes3d_bool, ChunkData => on_chunk_data, @@ -611,6 +612,7 @@ impl Server { MultiBlockChange_Packed => on_multi_block_change_packed, MultiBlockChange_VarInt => on_multi_block_change_varint, MultiBlockChange_u16 => on_multi_block_change_u16, + TeleportPlayer_WithDismount => on_teleport_player_withdismount, TeleportPlayer_WithConfirm => on_teleport_player_withconfirm, TeleportPlayer_NoConfirm => on_teleport_player_noconfirm, TeleportPlayer_OnGround => on_teleport_player_onground, @@ -1552,6 +1554,21 @@ impl Server { self.entity_map.insert(entity_id, entity); } + fn on_teleport_player_withdismount( + &mut self, + teleport: packet::play::clientbound::TeleportPlayer_WithDismount, + ) { + self.on_teleport_player( + teleport.x, + teleport.y, + teleport.z, + teleport.yaw as f64, + teleport.pitch as f64, + teleport.flags, + Some(teleport.teleport_id), + ) + } + fn on_teleport_player_withconfirm( &mut self, teleport: packet::play::clientbound::TeleportPlayer_WithConfirm, @@ -1928,6 +1945,23 @@ impl Server { } } + fn on_chunk_data_biomes3d_bitmasks( + &mut self, + chunk_data: packet::play::clientbound::ChunkData_Biomes3D_Bitmasks, + ) { + self.world + .load_chunk117( + chunk_data.chunk_x, + chunk_data.chunk_z, + true, + chunk_data.bitmasks.data[0] as u64, // TODO: get all bitmasks + 16, // TODO: get all bitmasks + chunk_data.data.data, + ) + .unwrap(); + self.load_block_entities(chunk_data.block_entities.data); + } + fn on_chunk_data_biomes3d_varint( &mut self, chunk_data: packet::play::clientbound::ChunkData_Biomes3D_VarInt, diff --git a/src/world/mod.rs b/src/world/mod.rs index 6a98873..71e348e 100644 --- a/src/world/mod.rs +++ b/src/world/mod.rs @@ -28,6 +28,7 @@ use flate2::read::ZlibDecoder; use std::cmp::Ordering; use std::collections::HashMap; use std::collections::VecDeque; +use std::convert::TryInto; use std::hash::BuildHasherDefault; use std::io::Read; @@ -620,8 +621,8 @@ impl World { Ok(()) } - fn dirty_chunks_by_bitmask(&mut self, x: i32, z: i32, mask: u16) { - for i in 0..16 { + fn dirty_chunks_by_bitmask(&mut self, x: i32, z: i32, mask: u64, num_sections: usize) { + for i in 0..num_sections { if mask & (1 << i) == 0 { continue; } @@ -637,6 +638,7 @@ impl World { { self.flag_section_dirty(x + pos.0, i as i32 + pos.1, z + pos.2); } + let i: i32 = i.try_into().unwrap(); self.update_range( (x << 4) - 1, (i << 4) - 1, @@ -737,7 +739,7 @@ impl World { chunk.calculate_heightmap(); } - self.dirty_chunks_by_bitmask(x, z, mask); + self.dirty_chunks_by_bitmask(x, z, mask.into(), 16); Ok(()) } @@ -965,7 +967,7 @@ impl World { chunk.calculate_heightmap(); } - self.dirty_chunks_by_bitmask(x, z, mask); + self.dirty_chunks_by_bitmask(x, z, mask.into(), 16); Ok(()) } @@ -977,7 +979,7 @@ impl World { mask: u16, data: Vec, ) -> Result<(), protocol::Error> { - self.load_chunk19_or_115(true, x, z, new, mask, data) + self.load_chunk19_to_117(true, x, z, new, mask.into(), 16, data) } pub fn load_chunk115( @@ -988,17 +990,30 @@ impl World { mask: u16, data: Vec, ) -> Result<(), protocol::Error> { - self.load_chunk19_or_115(false, x, z, new, mask, data) + self.load_chunk19_to_117(false, x, z, new, mask.into(), 16, data) + } + + pub fn load_chunk117( + &mut self, + x: i32, + z: i32, + new: bool, + mask: u64, + num_sections: usize, + data: Vec, + ) -> Result<(), protocol::Error> { + self.load_chunk19_to_117(false, x, z, new, mask, num_sections, data) } #[allow(clippy::or_fun_call)] - fn load_chunk19_or_115( + fn load_chunk19_to_117( &mut self, read_biomes: bool, x: i32, z: i32, new: bool, - mask: u16, + mask: u64, + num_sections: usize, data: Vec, ) -> Result<(), protocol::Error> { use crate::protocol::{LenPrefixed, Serializable, VarInt}; @@ -1016,7 +1031,7 @@ impl World { } let chunk = self.chunks.get_mut(&cpos).unwrap(); - for i in 0..16 { + for i in 0..num_sections { if chunk.sections[i].is_none() { let mut fill_sky = chunk.sections.iter().skip(i).all(|v| v.is_none()); fill_sky &= (mask & !((1 << i) | ((1 << i) - 1))) == 0; @@ -1101,7 +1116,7 @@ impl World { chunk.calculate_heightmap(); } - self.dirty_chunks_by_bitmask(x, z, mask); + self.dirty_chunks_by_bitmask(x, z, mask, num_sections); Ok(()) }