diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2026-01-13 10:51:45 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-13 10:51:45 -0600 |
| commit | b21ac946cafaacc9ee2478ea48ed9e72554f79ed (patch) | |
| tree | 4d05744b9801e94f5da6563d8fabddfb20d1c7b7 /azalea-core/src/entity_id.rs | |
| parent | d5fa5e32b37754b3b5c136e58821e48cd3b7c2ff (diff) | |
| download | azalea-drasl-b21ac946cafaacc9ee2478ea48ed9e72554f79ed.tar.xz | |
Merge AzaleaRead and AzaleaWrite (#305)
Diffstat (limited to 'azalea-core/src/entity_id.rs')
| -rw-r--r-- | azalea-core/src/entity_id.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/azalea-core/src/entity_id.rs b/azalea-core/src/entity_id.rs index c66d3a2e..59798e05 100644 --- a/azalea-core/src/entity_id.rs +++ b/azalea-core/src/entity_id.rs @@ -4,7 +4,7 @@ use std::{ io::{self, Cursor}, }; -use azalea_buf::{AzaleaRead, AzaleaReadVar, AzaleaWrite, AzaleaWriteVar, BufReadError}; +use azalea_buf::{AzBuf, AzBufVar, BufReadError}; use derive_more::{Deref, DerefMut}; // note: this is here instead of in azalea-entity because azalea-world depends @@ -41,22 +41,18 @@ impl nohash_hasher::IsEnabled for MinecraftEntityId {} // we can't have the default be #[var] because mojang doesn't use varints for // entities sometimes :( -impl AzaleaRead for MinecraftEntityId { +impl AzBuf for MinecraftEntityId { fn azalea_read(buf: &mut Cursor<&[u8]>) -> Result<Self, BufReadError> { i32::azalea_read(buf).map(MinecraftEntityId) } -} -impl AzaleaWrite for MinecraftEntityId { fn azalea_write(&self, buf: &mut impl io::Write) -> io::Result<()> { i32::azalea_write(&self.0, buf) } } -impl AzaleaReadVar for MinecraftEntityId { +impl AzBufVar for MinecraftEntityId { fn azalea_read_var(buf: &mut Cursor<&[u8]>) -> Result<Self, BufReadError> { i32::azalea_read_var(buf).map(MinecraftEntityId) } -} -impl AzaleaWriteVar for MinecraftEntityId { fn azalea_write_var(&self, buf: &mut impl io::Write) -> io::Result<()> { i32::azalea_write_var(&self.0, buf) } |
