Fix: all clippy warns

This commit is contained in:
Alexander Medvedev committed 2024-08-19 20:08:02 +01:00
1 parent a6d9ed216d
commit de7b3aa2ea
21 files changed
+35 -53

No files matched your search

+9 -5
View File
@@ -37,11 +37,15 @@ impl Client {
self.protocol_version = handshake.protocol_version.0;
self.connection_state = handshake.next_state;
if self.connection_state == ConnectionState::Login {
if self.protocol_version < CURRENT_MC_PROTOCOL as i32 {
let protocol = self.protocol_version;
self.kick(&format!("Client outdated ({protocol}), Server uses Minecraft {CURRENT_MC_VERSION}, Protocol {CURRENT_MC_PROTOCOL}"));
} else if self.protocol_version > CURRENT_MC_PROTOCOL as i32 {
self.kick(&format!("Server outdated, Server uses Minecraft {CURRENT_MC_VERSION}, Protocol {CURRENT_MC_PROTOCOL}"));
let protocol = self.protocol_version;
match protocol.cmp(&(CURRENT_MC_PROTOCOL as i32)) {
std::cmp::Ordering::Less => {
self.kick(&format!("Client outdated ({protocol}), Server uses Minecraft {CURRENT_MC_VERSION}, Protocol {CURRENT_MC_PROTOCOL}"));
}
std::cmp::Ordering::Equal => {}
std::cmp::Ordering::Greater => {
self.kick(&format!("Server outdated, Server uses Minecraft {CURRENT_MC_VERSION}, Protocol {CURRENT_MC_PROTOCOL}"));
}
}
}
}
+2 -3
View File
@@ -5,8 +5,7 @@ use pumpkin_entity::EntityId;
use pumpkin_protocol::{
client::play::{
Animation, CBlockUpdate, CEntityAnimation, CEntityVelocity, CHeadRot, CHurtAnimation,
CPlayerChatMessage, CUpdateEntityPos, CUpdateEntityPosRot,
CUpdateEntityRot, FilterType,
CPlayerChatMessage, CUpdateEntityPos, CUpdateEntityPosRot, CUpdateEntityRot, FilterType,
},
position::WorldPosition,
server::play::{
@@ -316,7 +315,7 @@ impl Client {
}
}
}
pub fn handle_player_action(&mut self, _server: &mut Server, player_action: SPlayerAction) {}
pub fn handle_player_action(&mut self, _server: &mut Server, _player_action: SPlayerAction) {}
pub fn handle_use_item_on(&mut self, server: &mut Server, use_item_on: SUseItemOn) {
let location = use_item_on.location;