From f62a681474df698d87deb43c71238b83a26f0f1f Mon Sep 17 00:00:00 2001 From: mat Date: Sat, 7 May 2022 21:44:11 -0500 Subject: remove entities packet --- azalea-protocol/src/mc_buf/read.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'azalea-protocol/src/mc_buf/read.rs') diff --git a/azalea-protocol/src/mc_buf/read.rs b/azalea-protocol/src/mc_buf/read.rs index 991bf53b..98a3ee53 100755 --- a/azalea-protocol/src/mc_buf/read.rs +++ b/azalea-protocol/src/mc_buf/read.rs @@ -360,6 +360,18 @@ impl McBufVarReadable for u16 { } } +// Vec varint +impl McBufVarReadable for Vec { + fn var_read_into(buf: &mut impl Read) -> Result { + let length = buf.read_varint()? as usize; + let mut contents = Vec::with_capacity(length); + for _ in 0..length { + contents.push(T::var_read_into(buf)?); + } + Ok(contents) + } +} + // i64 impl McBufReadable for i64 { fn read_into(buf: &mut impl Read) -> Result { -- cgit v1.2.3