diff options
| author | mat <github@matdoes.dev> | 2022-05-07 21:44:11 -0500 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-05-07 21:44:11 -0500 |
| commit | f62a681474df698d87deb43c71238b83a26f0f1f (patch) | |
| tree | 68b26f053faf818cf6780688f41d7840cdcc7494 /azalea-protocol/src/mc_buf/write.rs | |
| parent | 98eee6d908a5651c55131b80dc3c153a6708052e (diff) | |
| download | azalea-drasl-f62a681474df698d87deb43c71238b83a26f0f1f.tar.xz | |
remove entities packet
Diffstat (limited to 'azalea-protocol/src/mc_buf/write.rs')
| -rwxr-xr-x | azalea-protocol/src/mc_buf/write.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/azalea-protocol/src/mc_buf/write.rs b/azalea-protocol/src/mc_buf/write.rs index 66f129f1..e3e7a2be 100755 --- a/azalea-protocol/src/mc_buf/write.rs +++ b/azalea-protocol/src/mc_buf/write.rs @@ -257,6 +257,17 @@ impl McBufVarWritable for u16 { } } +// Vec<T> varint +impl<T: McBufVarWritable> McBufVarWritable for Vec<T> { + fn var_write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { + u32::var_write_into(&(self.len() as u32), buf)?; + for i in self { + i.var_write_into(buf)?; + } + Ok(()) + } +} + // u8 impl McBufWritable for u8 { fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { |
