diff options
| author | mat <git@matdoes.dev> | 2025-08-18 16:42:48 -0545 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-08-18 16:42:48 -0545 |
| commit | 9c39e05d37926de13588777ecd84f34d2f6e0a1d (patch) | |
| tree | ae6427df80f5e96a1e9f7370de30d398d917c5fa /azalea-inventory/src/components.rs | |
| parent | c2ada754f9888fe791a5f604534c55cc6da71590 (diff) | |
| download | azalea-drasl-9c39e05d37926de13588777ecd84f34d2f6e0a1d.tar.xz | |
fix ClientboundMerchantOffers
Diffstat (limited to 'azalea-inventory/src/components.rs')
| -rw-r--r-- | azalea-inventory/src/components.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/azalea-inventory/src/components.rs b/azalea-inventory/src/components.rs index 3da393e5..f63ca1ad 100644 --- a/azalea-inventory/src/components.rs +++ b/azalea-inventory/src/components.rs @@ -130,11 +130,15 @@ macro_rules! define_data_components { pub unsafe fn azalea_write_as( &self, kind: registry::DataComponentKind, - buf: &mut Vec<u8>, + buf: &mut impl std::io::Write, ) -> io::Result<()> { + let mut value = Vec::new(); match kind { - $( DataComponentKind::$x => unsafe { self.$x.encode(buf) }, )* - } + $( DataComponentKind::$x => unsafe { self.$x.encode(&mut value)? }, )* + }; + buf.write_all(&value)?; + + Ok(()) } /// # Safety /// |
