diff options
| author | mat <github@matdoes.dev> | 2022-06-25 14:25:56 -0500 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-06-25 14:25:56 -0500 |
| commit | c46eb556e2e7964f0709572a0151c181752c3182 (patch) | |
| tree | da65427d74aaa66e002385989faee04c7bac6cbd /azalea-nbt/src/encode.rs | |
| parent | 8755f18c2b0c11a51a81f60b5501d9d57d0c370e (diff) | |
| parent | 77980f0018eca3a192994021b76ad5d05bff88ea (diff) | |
| download | azalea-drasl-c46eb556e2e7964f0709572a0151c181752c3182.tar.xz | |
Merge branch 'main' into 1.19.1
Diffstat (limited to 'azalea-nbt/src/encode.rs')
| -rwxr-xr-x | azalea-nbt/src/encode.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/azalea-nbt/src/encode.rs b/azalea-nbt/src/encode.rs index fb5585b3..3763ffd1 100755 --- a/azalea-nbt/src/encode.rs +++ b/azalea-nbt/src/encode.rs @@ -1,5 +1,6 @@ use crate::Error; use crate::Tag; +use azalea_buf::McBufWritable; use byteorder::{WriteBytesExt, BE}; use flate2::write::{GzEncoder, ZlibEncoder}; use std::collections::HashMap; @@ -217,3 +218,10 @@ impl Tag { self.write(&mut encoder) } } + +impl McBufWritable for Tag { + fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> { + self.write(buf) + .map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e.to_string())) + } +} |
