diff options
| author | mat <github@matdoes.dev> | 2022-05-14 19:14:34 -0500 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-05-14 19:14:34 -0500 |
| commit | 42f86f73f256c0219a923c5ff67a509e7a8a898d (patch) | |
| tree | da9db6effc1503c003b3d08175a35ed3bfb546b7 /azalea-protocol/src/mc_buf/read.rs | |
| parent | 8fb95866093245bd802bebec08148c87f1188db3 (diff) | |
| download | azalea-drasl-42f86f73f256c0219a923c5ff67a509e7a8a898d.tar.xz | |
add unhandled ClientboundSectionBlocksUpdatePacket
Diffstat (limited to 'azalea-protocol/src/mc_buf/read.rs')
| -rw-r--r-- | azalea-protocol/src/mc_buf/read.rs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/azalea-protocol/src/mc_buf/read.rs b/azalea-protocol/src/mc_buf/read.rs index ebafad92..1c4fbd6f 100644 --- a/azalea-protocol/src/mc_buf/read.rs +++ b/azalea-protocol/src/mc_buf/read.rs @@ -2,7 +2,7 @@ use super::{UnsizedByteArray, MAX_STRING_LENGTH}; use azalea_chat::component::Component; use azalea_core::{ difficulty::Difficulty, game_type::GameType, resource_location::ResourceLocation, - serializable_uuid::SerializableUuid, BlockPos, Direction, Slot, SlotData, + serializable_uuid::SerializableUuid, BlockPos, ChunkSectionPos, Direction, Slot, SlotData, }; use byteorder::{ReadBytesExt, BE}; use serde::Deserialize; @@ -518,3 +518,15 @@ impl McBufReadable for Direction { } } } + +// ChunkSectionPos +impl McBufReadable for ChunkSectionPos { + fn read_into(buf: &mut impl Read) -> Result<Self, String> { + let long = i64::read_into(buf)?; + Ok(ChunkSectionPos { + x: (long >> 42) as i32, + y: (long << 44 >> 44) as i32, + z: (long << 22 >> 42) as i32, + }) + } +} |
