aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol/src/packets/game
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-05-03 18:20:24 +0000
committermat <github@matdoes.dev>2022-05-03 18:20:24 +0000
commitc9878129274258a30dc3ee0ecbd064b4fcf9bc6e (patch)
tree07e03b13eb71b4231159d42b5773e31371e83858 /azalea-protocol/src/packets/game
parent477c367fc44a2b5c139845f7e8307c6c276d95ee (diff)
downloadazalea-drasl-c9878129274258a30dc3ee0ecbd064b4fcf9bc6e.tar.xz
clippy
Diffstat (limited to 'azalea-protocol/src/packets/game')
-rwxr-xr-xazalea-protocol/src/packets/game/clientbound_declare_commands_packet.rs18
-rw-r--r--azalea-protocol/src/packets/game/clientbound_light_update_packet.rs1
-rwxr-xr-xazalea-protocol/src/packets/game/clientbound_player_abilities_packet.rs8
-rw-r--r--azalea-protocol/src/packets/game/clientbound_player_position_packet.rs10
-rw-r--r--azalea-protocol/src/packets/game/clientbound_recipe_packet.rs4
-rw-r--r--azalea-protocol/src/packets/game/clientbound_set_entity_data_packet.rs4
-rw-r--r--azalea-protocol/src/packets/game/clientbound_update_recipes_packet.rs2
7 files changed, 22 insertions, 25 deletions
diff --git a/azalea-protocol/src/packets/game/clientbound_declare_commands_packet.rs b/azalea-protocol/src/packets/game/clientbound_declare_commands_packet.rs
index 27f4fb16..6743c3af 100755
--- a/azalea-protocol/src/packets/game/clientbound_declare_commands_packet.rs
+++ b/azalea-protocol/src/packets/game/clientbound_declare_commands_packet.rs
@@ -281,7 +281,7 @@ impl McBufReadable for BrigadierParser {
}
}
-// azalea_brigadier::tree::CommandNode
+// TODO: BrigadierNodeStub should have more stuff
impl McBufReadable for BrigadierNodeStub {
fn read_into(buf: &mut impl Read) -> Result<Self, String> {
let flags = u8::read_into(buf)?;
@@ -292,20 +292,18 @@ impl McBufReadable for BrigadierNodeStub {
}
let node_type = flags & 0x03;
- let is_executable = flags & 0x04 != 0;
+ let _is_executable = flags & 0x04 != 0;
let has_redirect = flags & 0x08 != 0;
let has_suggestions_type = flags & 0x10 != 0;
- let children = buf.read_int_id_list()?;
- let redirect_node = if has_redirect { buf.read_varint()? } else { 0 };
+ let _children = buf.read_int_id_list()?;
+ let _redirect_node = if has_redirect { buf.read_varint()? } else { 0 };
// argument node
if node_type == 2 {
- let name = buf.read_utf()?;
-
- let parser = BrigadierParser::read_into(buf)?;
-
- let suggestions_type = if has_suggestions_type {
+ let _name = buf.read_utf()?;
+ let _parser = BrigadierParser::read_into(buf)?;
+ let _suggestions_type = if has_suggestions_type {
Some(buf.read_resource_location()?)
} else {
None
@@ -314,7 +312,7 @@ impl McBufReadable for BrigadierNodeStub {
}
// literal node
if node_type == 1 {
- let name = buf.read_utf()?;
+ let _name = buf.read_utf()?;
return Ok(BrigadierNodeStub {});
}
Ok(BrigadierNodeStub {})
diff --git a/azalea-protocol/src/packets/game/clientbound_light_update_packet.rs b/azalea-protocol/src/packets/game/clientbound_light_update_packet.rs
index c97eacff..e83d1e87 100644
--- a/azalea-protocol/src/packets/game/clientbound_light_update_packet.rs
+++ b/azalea-protocol/src/packets/game/clientbound_light_update_packet.rs
@@ -1,5 +1,4 @@
use crate::mc_buf::BitSet;
-use azalea_core::{game_type::GameType, resource_location::ResourceLocation};
use packet_macros::{GamePacket, McBufReadable, McBufWritable};
#[derive(Clone, Debug, GamePacket)]
diff --git a/azalea-protocol/src/packets/game/clientbound_player_abilities_packet.rs b/azalea-protocol/src/packets/game/clientbound_player_abilities_packet.rs
index cd645fe6..ed27ecf3 100755
--- a/azalea-protocol/src/packets/game/clientbound_player_abilities_packet.rs
+++ b/azalea-protocol/src/packets/game/clientbound_player_abilities_packet.rs
@@ -34,16 +34,16 @@ impl McBufWritable for PlayerAbilitiesFlags {
fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> {
let mut byte = 0;
if self.invulnerable {
- byte = byte | 1;
+ byte |= 0b1;
}
if self.flying {
- byte = byte | 2;
+ byte |= 0b10;
}
if self.can_fly {
- byte = byte | 4;
+ byte |= 0b100;
}
if self.instant_break {
- byte = byte | 8;
+ byte |= 0b1000;
}
u8::write_into(&byte, buf)
}
diff --git a/azalea-protocol/src/packets/game/clientbound_player_position_packet.rs b/azalea-protocol/src/packets/game/clientbound_player_position_packet.rs
index cac4665d..c2bef8fa 100644
--- a/azalea-protocol/src/packets/game/clientbound_player_position_packet.rs
+++ b/azalea-protocol/src/packets/game/clientbound_player_position_packet.rs
@@ -43,19 +43,19 @@ impl McBufWritable for RelativeArguments {
fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> {
let mut byte = 0;
if self.x {
- byte = byte | 0b1;
+ byte |= 0b1;
}
if self.y {
- byte = byte | 0b10;
+ byte |= 0b10;
}
if self.z {
- byte = byte | 0b100;
+ byte |= 0b100;
}
if self.y_rot {
- byte = byte | 0b1000;
+ byte |= 0b1000;
}
if self.x_rot {
- byte = byte | 0b10000;
+ byte |= 0b10000;
}
u8::write_into(&byte, buf)
}
diff --git a/azalea-protocol/src/packets/game/clientbound_recipe_packet.rs b/azalea-protocol/src/packets/game/clientbound_recipe_packet.rs
index 543fb64c..fa0d58f0 100644
--- a/azalea-protocol/src/packets/game/clientbound_recipe_packet.rs
+++ b/azalea-protocol/src/packets/game/clientbound_recipe_packet.rs
@@ -1,5 +1,5 @@
use crate::mc_buf::{McBufReadable, McBufWritable, Readable, Writable};
-use azalea_core::{resource_location::ResourceLocation, Slot};
+use azalea_core::resource_location::ResourceLocation;
use packet_macros::{GamePacket, McBufReadable, McBufWritable};
use std::io::{Read, Write};
@@ -41,7 +41,7 @@ impl McBufWritable for State {
}
impl McBufReadable for State {
fn read_into(buf: &mut impl Read) -> Result<Self, String> {
- let state = buf.read_varint()?.try_into().unwrap();
+ let state = buf.read_varint()?;
Ok(match state {
0 => State::Init,
1 => State::Add,
diff --git a/azalea-protocol/src/packets/game/clientbound_set_entity_data_packet.rs b/azalea-protocol/src/packets/game/clientbound_set_entity_data_packet.rs
index 5d288518..ca726c39 100644
--- a/azalea-protocol/src/packets/game/clientbound_set_entity_data_packet.rs
+++ b/azalea-protocol/src/packets/game/clientbound_set_entity_data_packet.rs
@@ -123,7 +123,7 @@ impl McBufReadable for EntityDataValue {
}
impl McBufWritable for EntityDataValue {
- fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> {
+ fn write_into(&self, _buf: &mut impl Write) -> Result<(), std::io::Error> {
todo!();
}
}
@@ -398,7 +398,7 @@ impl McBufReadable for ParticleData {
}
impl McBufWritable for ParticleData {
- fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> {
+ fn write_into(&self, _buf: &mut impl Write) -> Result<(), std::io::Error> {
todo!()
}
}
diff --git a/azalea-protocol/src/packets/game/clientbound_update_recipes_packet.rs b/azalea-protocol/src/packets/game/clientbound_update_recipes_packet.rs
index d15e10c3..9bdea26e 100644
--- a/azalea-protocol/src/packets/game/clientbound_update_recipes_packet.rs
+++ b/azalea-protocol/src/packets/game/clientbound_update_recipes_packet.rs
@@ -122,7 +122,7 @@ pub struct Ingredient {
}
impl McBufWritable for Recipe {
- fn write_into(&self, buf: &mut impl Write) -> Result<(), std::io::Error> {
+ fn write_into(&self, _buf: &mut impl Write) -> Result<(), std::io::Error> {
todo!()
}
}