aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol/src/packets/game
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-05-30 19:36:59 -0800
committermat <git@matdoes.dev>2025-05-30 19:36:59 -0800
commitae4b1e85e669bc882d158509ef1eda46c6b2a72e (patch)
treeadf81cc01b0ce1575e95b99ad109fd92db1738f6 /azalea-protocol/src/packets/game
parenta64c6505049082175224802c5be51ac8f0cf4677 (diff)
downloadazalea-drasl-ae4b1e85e669bc882d158509ef1eda46c6b2a72e.tar.xz
fix clippy issues and improve formatting everywhere
Diffstat (limited to 'azalea-protocol/src/packets/game')
-rw-r--r--azalea-protocol/src/packets/game/c_boss_event.rs5
-rw-r--r--azalea-protocol/src/packets/game/c_commands.rs8
-rw-r--r--azalea-protocol/src/packets/game/c_damage_event.rs4
-rw-r--r--azalea-protocol/src/packets/game/c_map_item_data.rs6
-rw-r--r--azalea-protocol/src/packets/game/c_player_abilities.rs4
-rw-r--r--azalea-protocol/src/packets/game/c_player_chat.rs4
-rw-r--r--azalea-protocol/src/packets/game/c_player_info_update.rs6
-rw-r--r--azalea-protocol/src/packets/game/c_section_blocks_update.rs4
-rw-r--r--azalea-protocol/src/packets/game/c_set_equipment.rs4
-rw-r--r--azalea-protocol/src/packets/game/c_set_objective.rs6
-rw-r--r--azalea-protocol/src/packets/game/c_stop_sound.rs4
-rw-r--r--azalea-protocol/src/packets/game/c_update_advancements.rs4
-rw-r--r--azalea-protocol/src/packets/game/c_update_tags.rs6
-rw-r--r--azalea-protocol/src/packets/game/s_interact.rs4
-rw-r--r--azalea-protocol/src/packets/game/s_player_abilities.rs4
-rw-r--r--azalea-protocol/src/packets/game/s_player_input.rs4
-rw-r--r--azalea-protocol/src/packets/game/s_seen_advancements.rs4
-rw-r--r--azalea-protocol/src/packets/game/s_set_command_block.rs4
-rw-r--r--azalea-protocol/src/packets/game/s_set_jigsaw_block.rs3
-rw-r--r--azalea-protocol/src/packets/game/s_set_structure_block.rs4
-rw-r--r--azalea-protocol/src/packets/game/s_use_item_on.rs4
21 files changed, 50 insertions, 46 deletions
diff --git a/azalea-protocol/src/packets/game/c_boss_event.rs b/azalea-protocol/src/packets/game/c_boss_event.rs
index 259a2781..18984985 100644
--- a/azalea-protocol/src/packets/game/c_boss_event.rs
+++ b/azalea-protocol/src/packets/game/c_boss_event.rs
@@ -1,3 +1,4 @@
+use std::io;
use std::io::Cursor;
use std::io::Write;
@@ -43,7 +44,7 @@ impl AzaleaRead for Operation {
}
impl AzaleaWrite for Operation {
- fn azalea_write(&self, buf: &mut impl Write) -> Result<(), std::io::Error> {
+ fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> {
match self {
Operation::Add(add) => {
0u32.azalea_write_var(buf)?;
@@ -126,7 +127,7 @@ impl AzaleaRead for Properties {
}
impl AzaleaWrite for Properties {
- fn azalea_write(&self, buf: &mut impl Write) -> Result<(), std::io::Error> {
+ fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> {
let mut set = FixedBitSet::<3>::new();
if self.darken_screen {
set.set(0);
diff --git a/azalea-protocol/src/packets/game/c_commands.rs b/azalea-protocol/src/packets/game/c_commands.rs
index c57f3d41..d2fa79a7 100644
--- a/azalea-protocol/src/packets/game/c_commands.rs
+++ b/azalea-protocol/src/packets/game/c_commands.rs
@@ -1,4 +1,4 @@
-use std::io::{Cursor, Write};
+use std::io::{self, Cursor, Write};
use azalea_buf::{AzBuf, AzaleaRead, AzaleaReadVar, AzaleaWrite, AzaleaWriteVar, BufReadError};
use azalea_core::{bitset::FixedBitSet, resource_location::ResourceLocation};
@@ -61,7 +61,7 @@ impl<T: AzaleaRead> AzaleaRead for BrigadierNumber<T> {
}
}
impl<T: AzaleaWrite> AzaleaWrite for BrigadierNumber<T> {
- fn azalea_write(&self, buf: &mut impl Write) -> Result<(), std::io::Error> {
+ fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> {
let mut flags = FixedBitSet::<2>::new();
if self.min.is_some() {
flags.set(0);
@@ -166,7 +166,7 @@ impl AzaleaRead for EntityParser {
}
}
impl AzaleaWrite for EntityParser {
- fn azalea_write(&self, buf: &mut impl Write) -> Result<(), std::io::Error> {
+ fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> {
let mut flags = FixedBitSet::<2>::new();
if self.single {
flags.set(0);
@@ -242,7 +242,7 @@ impl AzaleaRead for BrigadierNodeStub {
}
impl AzaleaWrite for BrigadierNodeStub {
- fn azalea_write(&self, buf: &mut impl Write) -> Result<(), std::io::Error> {
+ fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> {
let mut flags = FixedBitSet::<4>::new();
if self.is_executable {
flags.set(2);
diff --git a/azalea-protocol/src/packets/game/c_damage_event.rs b/azalea-protocol/src/packets/game/c_damage_event.rs
index d4393685..b7fd15c1 100644
--- a/azalea-protocol/src/packets/game/c_damage_event.rs
+++ b/azalea-protocol/src/packets/game/c_damage_event.rs
@@ -1,4 +1,4 @@
-use std::io::{Cursor, Write};
+use std::io::{self, Cursor, Write};
use azalea_buf::{AzBuf, AzaleaRead, AzaleaReadVar, AzaleaWrite, AzaleaWriteVar};
use azalea_core::position::Vec3;
@@ -27,7 +27,7 @@ impl AzaleaRead for OptionalEntityId {
}
}
impl AzaleaWrite for OptionalEntityId {
- fn azalea_write(&self, buf: &mut impl Write) -> Result<(), std::io::Error> {
+ fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> {
match self.0 {
Some(id) => (id + 1).azalea_write_var(buf),
None => 0u32.azalea_write_var(buf),
diff --git a/azalea-protocol/src/packets/game/c_map_item_data.rs b/azalea-protocol/src/packets/game/c_map_item_data.rs
index 9a41ed85..f8c036e3 100644
--- a/azalea-protocol/src/packets/game/c_map_item_data.rs
+++ b/azalea-protocol/src/packets/game/c_map_item_data.rs
@@ -1,3 +1,5 @@
+use std::io::{self, Cursor, Write};
+
use azalea_buf::{AzBuf, AzaleaRead, AzaleaWrite};
use azalea_chat::FormattedText;
use azalea_protocol_macros::ClientboundGamePacket;
@@ -27,7 +29,7 @@ pub struct MapDecoration {
pub struct OptionalMapPatch(pub Option<MapPatch>);
impl AzaleaRead for OptionalMapPatch {
- fn azalea_read(buf: &mut std::io::Cursor<&[u8]>) -> Result<Self, azalea_buf::BufReadError> {
+ fn azalea_read(buf: &mut Cursor<&[u8]>) -> Result<Self, azalea_buf::BufReadError> {
let pos = buf.position();
Ok(Self(if u8::azalea_read(buf)? == 0 {
None
@@ -39,7 +41,7 @@ impl AzaleaRead for OptionalMapPatch {
}
impl AzaleaWrite for OptionalMapPatch {
- fn azalea_write(&self, buf: &mut impl std::io::Write) -> Result<(), std::io::Error> {
+ fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> {
match &self.0 {
None => 0u8.azalea_write(buf),
Some(m) => m.azalea_write(buf),
diff --git a/azalea-protocol/src/packets/game/c_player_abilities.rs b/azalea-protocol/src/packets/game/c_player_abilities.rs
index c32a99fe..3f4e1024 100644
--- a/azalea-protocol/src/packets/game/c_player_abilities.rs
+++ b/azalea-protocol/src/packets/game/c_player_abilities.rs
@@ -1,4 +1,4 @@
-use std::io::{Cursor, Write};
+use std::io::{self, Cursor, Write};
use azalea_buf::{AzBuf, BufReadError};
use azalea_buf::{AzaleaRead, AzaleaWrite};
@@ -34,7 +34,7 @@ impl AzaleaRead for PlayerAbilitiesFlags {
}
impl AzaleaWrite for PlayerAbilitiesFlags {
- fn azalea_write(&self, buf: &mut impl Write) -> Result<(), std::io::Error> {
+ fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> {
let mut set = FixedBitSet::<4>::new();
if self.invulnerable {
set.set(0);
diff --git a/azalea-protocol/src/packets/game/c_player_chat.rs b/azalea-protocol/src/packets/game/c_player_chat.rs
index 77dce487..d44e5f59 100644
--- a/azalea-protocol/src/packets/game/c_player_chat.rs
+++ b/azalea-protocol/src/packets/game/c_player_chat.rs
@@ -1,4 +1,4 @@
-use std::io::{Cursor, Write};
+use std::io::{self, Cursor, Write};
use azalea_buf::{AzBuf, AzaleaRead, AzaleaReadVar, AzaleaWrite, AzaleaWriteVar, BufReadError};
use azalea_chat::{
@@ -142,7 +142,7 @@ impl AzaleaRead for PackedMessageSignature {
}
}
impl AzaleaWrite for PackedMessageSignature {
- fn azalea_write(&self, buf: &mut impl Write) -> Result<(), std::io::Error> {
+ fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> {
match self {
PackedMessageSignature::Signature(full_signature) => {
0u32.azalea_write_var(buf)?;
diff --git a/azalea-protocol/src/packets/game/c_player_info_update.rs b/azalea-protocol/src/packets/game/c_player_info_update.rs
index c8e32a33..0041b483 100644
--- a/azalea-protocol/src/packets/game/c_player_info_update.rs
+++ b/azalea-protocol/src/packets/game/c_player_info_update.rs
@@ -1,6 +1,6 @@
use std::{
collections::HashMap,
- io::{Cursor, Write},
+ io::{self, Cursor, Write},
};
use azalea_auth::game_profile::{GameProfile, ProfilePropertyValue};
@@ -119,7 +119,7 @@ impl AzaleaRead for ClientboundPlayerInfoUpdate {
}
impl AzaleaWrite for ClientboundPlayerInfoUpdate {
- fn azalea_write(&self, buf: &mut impl Write) -> Result<(), std::io::Error> {
+ fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> {
self.actions.azalea_write(buf)?;
(self.entries.len() as u32).azalea_write_var(buf)?;
@@ -198,7 +198,7 @@ impl AzaleaRead for ActionEnumSet {
}
impl AzaleaWrite for ActionEnumSet {
- fn azalea_write(&self, buf: &mut impl Write) -> Result<(), std::io::Error> {
+ fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> {
let mut set = FixedBitSet::<7>::new();
if self.add_player {
set.set(0);
diff --git a/azalea-protocol/src/packets/game/c_section_blocks_update.rs b/azalea-protocol/src/packets/game/c_section_blocks_update.rs
index 2a7a867e..b9d07db3 100644
--- a/azalea-protocol/src/packets/game/c_section_blocks_update.rs
+++ b/azalea-protocol/src/packets/game/c_section_blocks_update.rs
@@ -1,4 +1,4 @@
-use std::io::{Cursor, Write};
+use std::io::{self, Cursor, Write};
use azalea_block::BlockState;
use azalea_buf::{AzBuf, AzaleaRead, AzaleaReadVar, AzaleaWrite, AzaleaWriteVar, BufReadError};
@@ -34,7 +34,7 @@ impl AzaleaRead for BlockStateWithPosition {
}
impl AzaleaWrite for BlockStateWithPosition {
- fn azalea_write(&self, buf: &mut impl Write) -> Result<(), std::io::Error> {
+ fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> {
let data = ((self.state.id() as u64) << 12)
| ((u64::from(self.pos.x) << 8) | (u64::from(self.pos.z) << 4) | u64::from(self.pos.y));
u64::azalea_write_var(&data, buf)?;
diff --git a/azalea-protocol/src/packets/game/c_set_equipment.rs b/azalea-protocol/src/packets/game/c_set_equipment.rs
index ad691d66..c80e0072 100644
--- a/azalea-protocol/src/packets/game/c_set_equipment.rs
+++ b/azalea-protocol/src/packets/game/c_set_equipment.rs
@@ -1,4 +1,4 @@
-use std::io::Cursor;
+use std::io::{self, Cursor, Write};
use azalea_buf::{AzBuf, BufReadError};
use azalea_buf::{AzaleaRead, AzaleaWrite};
@@ -41,7 +41,7 @@ impl AzaleaRead for EquipmentSlots {
}
}
impl AzaleaWrite for EquipmentSlots {
- fn azalea_write(&self, buf: &mut impl std::io::Write) -> Result<(), std::io::Error> {
+ fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> {
for i in 0..self.slots.len() {
let (equipment_slot, item) = &self.slots[i];
let mut equipment_byte = *equipment_slot as u8;
diff --git a/azalea-protocol/src/packets/game/c_set_objective.rs b/azalea-protocol/src/packets/game/c_set_objective.rs
index 7ddb3f71..0f5ffdc1 100644
--- a/azalea-protocol/src/packets/game/c_set_objective.rs
+++ b/azalea-protocol/src/packets/game/c_set_objective.rs
@@ -1,7 +1,7 @@
-use std::io::{Cursor, Write};
+use std::io::{self, Cursor, Write};
use azalea_buf::{AzBuf, AzaleaRead, AzaleaWrite};
-use azalea_chat::{numbers::NumberFormat, FormattedText};
+use azalea_chat::{FormattedText, numbers::NumberFormat};
use azalea_core::objectives::ObjectiveCriteria;
use azalea_protocol_macros::ClientboundGamePacket;
@@ -53,7 +53,7 @@ impl AzaleaRead for Method {
}
impl AzaleaWrite for Method {
- fn azalea_write(&self, buf: &mut impl Write) -> Result<(), std::io::Error> {
+ fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> {
match self {
Method::Add {
display_name,
diff --git a/azalea-protocol/src/packets/game/c_stop_sound.rs b/azalea-protocol/src/packets/game/c_stop_sound.rs
index e3cd737e..da689882 100644
--- a/azalea-protocol/src/packets/game/c_stop_sound.rs
+++ b/azalea-protocol/src/packets/game/c_stop_sound.rs
@@ -1,4 +1,4 @@
-use std::io::{Cursor, Write};
+use std::io::{self, Cursor, Write};
use azalea_buf::{AzaleaRead, AzaleaWrite, BufReadError};
use azalea_core::{bitset::FixedBitSet, resource_location::ResourceLocation};
@@ -31,7 +31,7 @@ impl AzaleaRead for ClientboundStopSound {
}
impl AzaleaWrite for ClientboundStopSound {
- fn azalea_write(&self, buf: &mut impl Write) -> Result<(), std::io::Error> {
+ fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> {
let mut set = FixedBitSet::<2>::new();
if self.source.is_some() {
set.set(0);
diff --git a/azalea-protocol/src/packets/game/c_update_advancements.rs b/azalea-protocol/src/packets/game/c_update_advancements.rs
index 1c645965..43542e56 100644
--- a/azalea-protocol/src/packets/game/c_update_advancements.rs
+++ b/azalea-protocol/src/packets/game/c_update_advancements.rs
@@ -1,5 +1,5 @@
use std::collections::HashMap;
-use std::io::Cursor;
+use std::io::{self, Cursor, Write};
use azalea_buf::AzBuf;
use azalea_chat::FormattedText;
@@ -38,7 +38,7 @@ pub struct DisplayInfo {
}
impl azalea_buf::AzaleaWrite for DisplayInfo {
- fn azalea_write(&self, buf: &mut impl std::io::Write) -> Result<(), std::io::Error> {
+ fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> {
self.title.azalea_write(buf)?;
self.description.azalea_write(buf)?;
self.icon.azalea_write(buf)?;
diff --git a/azalea-protocol/src/packets/game/c_update_tags.rs b/azalea-protocol/src/packets/game/c_update_tags.rs
index 4b63ec8f..108f8772 100644
--- a/azalea-protocol/src/packets/game/c_update_tags.rs
+++ b/azalea-protocol/src/packets/game/c_update_tags.rs
@@ -1,4 +1,4 @@
-use std::io::Cursor;
+use std::io::{self, Cursor};
use std::ops::Deref;
use std::{collections::HashMap, io::Write};
@@ -40,7 +40,7 @@ impl AzaleaRead for TagMap {
}
impl AzaleaWrite for TagMap {
- fn azalea_write(&self, buf: &mut impl Write) -> Result<(), std::io::Error> {
+ fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> {
(self.len() as u32).azalea_write_var(buf)?;
for (k, v) in &self.0 {
k.azalea_write(buf)?;
@@ -58,7 +58,7 @@ impl AzaleaRead for Tags {
}
impl AzaleaWrite for Tags {
- fn azalea_write(&self, buf: &mut impl Write) -> Result<(), std::io::Error> {
+ fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> {
self.name.azalea_write(buf)?;
self.elements.azalea_write_var(buf)?;
Ok(())
diff --git a/azalea-protocol/src/packets/game/s_interact.rs b/azalea-protocol/src/packets/game/s_interact.rs
index a3007749..762afe4e 100644
--- a/azalea-protocol/src/packets/game/s_interact.rs
+++ b/azalea-protocol/src/packets/game/s_interact.rs
@@ -1,4 +1,4 @@
-use std::io::{Cursor, Write};
+use std::io::{self, Cursor, Write};
use azalea_buf::{AzBuf, AzaleaRead, AzaleaReadVar, AzaleaWrite, AzaleaWriteVar};
use azalea_core::position::Vec3;
@@ -29,7 +29,7 @@ pub enum ActionType {
}
impl AzaleaWrite for ActionType {
- fn azalea_write(&self, buf: &mut impl Write) -> Result<(), std::io::Error> {
+ fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> {
match self {
ActionType::Interact { hand } => {
0u32.azalea_write_var(buf)?;
diff --git a/azalea-protocol/src/packets/game/s_player_abilities.rs b/azalea-protocol/src/packets/game/s_player_abilities.rs
index fdf2d8a4..da194228 100644
--- a/azalea-protocol/src/packets/game/s_player_abilities.rs
+++ b/azalea-protocol/src/packets/game/s_player_abilities.rs
@@ -1,4 +1,4 @@
-use std::io::Cursor;
+use std::io::{self, Cursor, Write};
use azalea_buf::{AzaleaRead, AzaleaWrite};
use azalea_core::bitset::FixedBitSet;
@@ -21,7 +21,7 @@ impl AzaleaRead for ServerboundPlayerAbilities {
}
impl AzaleaWrite for ServerboundPlayerAbilities {
- fn azalea_write(&self, buf: &mut impl std::io::Write) -> Result<(), std::io::Error> {
+ fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> {
let mut set = FixedBitSet::<2>::new();
if self.is_flying {
set.set(1);
diff --git a/azalea-protocol/src/packets/game/s_player_input.rs b/azalea-protocol/src/packets/game/s_player_input.rs
index 7032bcff..a12262b4 100644
--- a/azalea-protocol/src/packets/game/s_player_input.rs
+++ b/azalea-protocol/src/packets/game/s_player_input.rs
@@ -1,4 +1,4 @@
-use std::io::Cursor;
+use std::io::{self, Cursor, Write};
use azalea_buf::BufReadError;
use azalea_buf::{AzaleaRead, AzaleaWrite};
@@ -32,7 +32,7 @@ impl AzaleaRead for ServerboundPlayerInput {
}
impl AzaleaWrite for ServerboundPlayerInput {
- fn azalea_write(&self, buf: &mut impl std::io::Write) -> Result<(), std::io::Error> {
+ fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> {
let mut set = FixedBitSet::<7>::new();
if self.forward {
set.set(0);
diff --git a/azalea-protocol/src/packets/game/s_seen_advancements.rs b/azalea-protocol/src/packets/game/s_seen_advancements.rs
index f46411f0..d6fef907 100644
--- a/azalea-protocol/src/packets/game/s_seen_advancements.rs
+++ b/azalea-protocol/src/packets/game/s_seen_advancements.rs
@@ -1,4 +1,4 @@
-use std::io::Cursor;
+use std::io::{self, Cursor, Write};
use azalea_buf::{AzBuf, AzaleaRead, AzaleaWrite};
use azalea_core::resource_location::ResourceLocation;
@@ -31,7 +31,7 @@ impl AzaleaRead for ServerboundSeenAdvancements {
}
impl AzaleaWrite for ServerboundSeenAdvancements {
- fn azalea_write(&self, buf: &mut impl std::io::Write) -> Result<(), std::io::Error> {
+ fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> {
self.action.azalea_write(buf)?;
if let Some(tab) = &self.tab {
tab.azalea_write(buf)?;
diff --git a/azalea-protocol/src/packets/game/s_set_command_block.rs b/azalea-protocol/src/packets/game/s_set_command_block.rs
index dacb79de..89cece2c 100644
--- a/azalea-protocol/src/packets/game/s_set_command_block.rs
+++ b/azalea-protocol/src/packets/game/s_set_command_block.rs
@@ -1,4 +1,4 @@
-use std::io::Cursor;
+use std::io::{self, Cursor, Write};
use azalea_buf::{AzBuf, AzaleaRead, BufReadError};
use azalea_core::{bitset::FixedBitSet, position::BlockPos};
@@ -43,7 +43,7 @@ impl AzaleaRead for ServerboundSetCommandBlock {
}
impl AzaleaWrite for ServerboundSetCommandBlock {
- fn azalea_write(&self, buf: &mut impl std::io::Write) -> Result<(), std::io::Error> {
+ fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> {
self.pos.azalea_write(buf)?;
self.command.azalea_write(buf)?;
self.mode.azalea_write(buf)?;
diff --git a/azalea-protocol/src/packets/game/s_set_jigsaw_block.rs b/azalea-protocol/src/packets/game/s_set_jigsaw_block.rs
index 1d97d4c7..8c218ffd 100644
--- a/azalea-protocol/src/packets/game/s_set_jigsaw_block.rs
+++ b/azalea-protocol/src/packets/game/s_set_jigsaw_block.rs
@@ -1,3 +1,4 @@
+use std::io;
use std::io::Cursor;
use std::io::Write;
@@ -41,7 +42,7 @@ impl AzaleaRead for JointType {
}
impl AzaleaWrite for JointType {
- fn azalea_write(&self, buf: &mut impl Write) -> Result<(), std::io::Error> {
+ fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> {
match self {
JointType::Rollable => "rollable".to_string().azalea_write(buf)?,
JointType::Aligned => "aligned".to_string().azalea_write(buf)?,
diff --git a/azalea-protocol/src/packets/game/s_set_structure_block.rs b/azalea-protocol/src/packets/game/s_set_structure_block.rs
index 360d34fc..8d518292 100644
--- a/azalea-protocol/src/packets/game/s_set_structure_block.rs
+++ b/azalea-protocol/src/packets/game/s_set_structure_block.rs
@@ -1,4 +1,4 @@
-use std::io::{Cursor, Write};
+use std::io::{self, Cursor, Write};
use azalea_buf::AzBuf;
use azalea_buf::{AzaleaRead, AzaleaWrite};
@@ -83,7 +83,7 @@ impl AzaleaRead for Flags {
}
impl AzaleaWrite for Flags {
- fn azalea_write(&self, buf: &mut impl Write) -> Result<(), std::io::Error> {
+ fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> {
let mut set = FixedBitSet::<3>::new();
if self.ignore_entities {
set.set(0);
diff --git a/azalea-protocol/src/packets/game/s_use_item_on.rs b/azalea-protocol/src/packets/game/s_use_item_on.rs
index cfe4a5d3..11e32b2c 100644
--- a/azalea-protocol/src/packets/game/s_use_item_on.rs
+++ b/azalea-protocol/src/packets/game/s_use_item_on.rs
@@ -1,4 +1,4 @@
-use std::io::{Cursor, Write};
+use std::io::{self, Cursor, Write};
use azalea_buf::{AzBuf, AzaleaRead, AzaleaWrite, BufReadError};
use azalea_core::{
@@ -35,7 +35,7 @@ pub struct BlockHit {
}
impl AzaleaWrite for BlockHit {
- fn azalea_write(&self, buf: &mut impl Write) -> Result<(), std::io::Error> {
+ fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> {
self.block_pos.azalea_write(buf)?;
self.direction.azalea_write(buf)?;
f32::azalea_write(