From f4dd3a9293367fa8f3d839a184e8055b22595204 Mon Sep 17 00:00:00 2001 From: mat Date: Sun, 24 Apr 2022 22:46:41 -0500 Subject: ENCRYPTION WORKS!!!!!!!!!!! --- azalea-protocol/src/mc_buf/mod.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'azalea-protocol/src/mc_buf/mod.rs') diff --git a/azalea-protocol/src/mc_buf/mod.rs b/azalea-protocol/src/mc_buf/mod.rs index 4ecb65d1..3ba6ac3e 100755 --- a/azalea-protocol/src/mc_buf/mod.rs +++ b/azalea-protocol/src/mc_buf/mod.rs @@ -5,11 +5,31 @@ mod write; pub use read::{McBufReadable, McBufVarintReadable, Readable}; pub use write::{McBufVarintWritable, McBufWritable, Writable}; +use std::ops::Deref; // const DEFAULT_NBT_QUOTA: u32 = 2097152; const MAX_STRING_LENGTH: u16 = 32767; // const MAX_COMPONENT_STRING_LENGTH: u32 = 262144; + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct ByteArray(Vec); + +impl Deref for ByteArray { + type Target = Vec; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +impl From> for ByteArray { + fn from(vec: Vec) -> Self { + Self(vec) + } +} + + #[cfg(test)] mod tests { use super::*; -- cgit v1.2.3