aboutsummaryrefslogtreecommitdiff
path: root/azalea-entity/src/data.rs
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2026-01-13 10:51:45 -0600
committerGitHub <noreply@github.com>2026-01-13 10:51:45 -0600
commitb21ac946cafaacc9ee2478ea48ed9e72554f79ed (patch)
tree4d05744b9801e94f5da6563d8fabddfb20d1c7b7 /azalea-entity/src/data.rs
parentd5fa5e32b37754b3b5c136e58821e48cd3b7c2ff (diff)
downloadazalea-drasl-b21ac946cafaacc9ee2478ea48ed9e72554f79ed.tar.xz
Merge AzaleaRead and AzaleaWrite (#305)
Diffstat (limited to 'azalea-entity/src/data.rs')
-rw-r--r--azalea-entity/src/data.rs11
1 files changed, 3 insertions, 8 deletions
diff --git a/azalea-entity/src/data.rs b/azalea-entity/src/data.rs
index 0b973bcb..e481b9d1 100644
--- a/azalea-entity/src/data.rs
+++ b/azalea-entity/src/data.rs
@@ -5,7 +5,7 @@
use std::io::{self, Cursor, Write};
-use azalea_buf::{AzBuf, AzaleaRead, AzaleaReadVar, AzaleaWrite, AzaleaWriteVar, BufReadError};
+use azalea_buf::{AzBuf, AzBufVar, BufReadError};
use azalea_chat::FormattedText;
use azalea_core::{
direction::Direction,
@@ -30,7 +30,7 @@ pub struct EntityDataItem {
pub value: EntityDataValue,
}
-impl AzaleaRead for EntityMetadataItems {
+impl AzBuf for EntityMetadataItems {
fn azalea_read(buf: &mut Cursor<&[u8]>) -> Result<Self, BufReadError> {
let mut metadata = Vec::new();
loop {
@@ -43,9 +43,6 @@ impl AzaleaRead for EntityMetadataItems {
}
Ok(EntityMetadataItems(metadata))
}
-}
-
-impl AzaleaWrite for EntityMetadataItems {
fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> {
for item in &self.0 {
item.index.azalea_write(buf)?;
@@ -126,7 +123,7 @@ pub enum ArmadilloStateKind {
Scared,
}
-impl AzaleaRead for OptionalUnsignedInt {
+impl AzBuf for OptionalUnsignedInt {
fn azalea_read(buf: &mut Cursor<&[u8]>) -> Result<Self, BufReadError> {
let val = u32::azalea_read_var(buf)?;
Ok(OptionalUnsignedInt(if val == 0 {
@@ -135,8 +132,6 @@ impl AzaleaRead for OptionalUnsignedInt {
Some(val - 1)
}))
}
-}
-impl AzaleaWrite for OptionalUnsignedInt {
fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> {
match self.0 {
Some(val) => (val + 1).azalea_write_var(buf),