diff options
| author | mat <github@matdoes.dev> | 2022-05-01 23:06:56 -0500 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-05-01 23:06:56 -0500 |
| commit | bec2da64d81883e3ea909452e71e17b9d22b2adc (patch) | |
| tree | d4f94abc09534768f2531a4c23f54dcc2dab2814 /azalea-protocol/src/packets/game/clientbound_update_attributes_packet.rs | |
| parent | 4d75415130a008f83c3bd594ca4cefd01f3d53dd (diff) | |
| parent | db2fcecdc38ea7a43b098c6282dd906b73981f97 (diff) | |
| download | azalea-drasl-bec2da64d81883e3ea909452e71e17b9d22b2adc.tar.xz | |
Merge branch 'main' into chunk-decoding
Diffstat (limited to 'azalea-protocol/src/packets/game/clientbound_update_attributes_packet.rs')
| -rw-r--r-- | azalea-protocol/src/packets/game/clientbound_update_attributes_packet.rs | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/azalea-protocol/src/packets/game/clientbound_update_attributes_packet.rs b/azalea-protocol/src/packets/game/clientbound_update_attributes_packet.rs index d7f86931..6e0aae29 100644 --- a/azalea-protocol/src/packets/game/clientbound_update_attributes_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_update_attributes_packet.rs @@ -1,11 +1,9 @@ -use async_trait::async_trait; -use azalea_core::{game_type::GameType, resource_location::ResourceLocation}; +use crate::mc_buf::{McBufReadable, McBufWritable, Readable, Writable}; +use azalea_core::resource_location::ResourceLocation; use packet_macros::{GamePacket, McBufReadable, McBufWritable}; -use tokio::io::AsyncRead; +use std::io::Read; use uuid::Uuid; -use crate::mc_buf::{McBufReadable, McBufWritable, Readable, Writable}; - #[derive(Clone, Debug, GamePacket)] pub struct ClientboundUpdateAttributesPacket { #[varint] @@ -34,13 +32,9 @@ enum Operation { MultiplyTotal = 2, } -#[async_trait] impl McBufReadable for Operation { - async fn read_into<R>(buf: &mut R) -> Result<Self, String> - where - R: AsyncRead + std::marker::Unpin + std::marker::Send, - { - match buf.read_byte().await? { + fn read_into(buf: &mut impl Read) -> Result<Self, String> { + match buf.read_byte()? { 0 => Ok(Operation::Addition), 1 => Ok(Operation::MultiplyBase), 2 => Ok(Operation::MultiplyTotal), |
