diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2022-06-25 05:09:26 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-25 05:09:26 +0000 |
| commit | 7d3e57763e32ac9cf94180b1c714704cfbc3034d (patch) | |
| tree | 2dcfe72bf09a42f6614f9dc988dc0254162ea0bf /azalea-nbt/src/encode.rs | |
| parent | 69c47eda4c496b13dadd80976bffd2fab7ea5894 (diff) | |
| parent | ca7067e173129f3044ebc8c77634f06da29a086e (diff) | |
| download | azalea-drasl-7d3e57763e32ac9cf94180b1c714704cfbc3034d.tar.xz | |
Merge pull request #10 from mat-1/azalea-entity
azalea-entity
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())) + } +} |
