From 1a2201f858843377f52856107b248f51860d45a5 Mon Sep 17 00:00:00 2001 From: suprohub Date: Mon, 24 Feb 2025 18:13:35 +0400 Subject: [PATCH] fmt --- pumpkin-protocol/src/client/play/damage_event.rs | 1 - pumpkin-protocol/src/client/play/entity_velocity.rs | 4 ++-- pumpkin-protocol/src/client/play/player_position.rs | 8 ++++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/pumpkin-protocol/src/client/play/damage_event.rs b/pumpkin-protocol/src/client/play/damage_event.rs index d55efc840..f8b856a5a 100644 --- a/pumpkin-protocol/src/client/play/damage_event.rs +++ b/pumpkin-protocol/src/client/play/damage_event.rs @@ -1,6 +1,5 @@ use pumpkin_data::packet::clientbound::PLAY_DAMAGE_EVENT; use pumpkin_macros::packet; -use pumpkin_util::math::pos::BlockPos; use pumpkin_util::math::vec3::Vec3; use serde::Serialize; diff --git a/pumpkin-protocol/src/client/play/entity_velocity.rs b/pumpkin-protocol/src/client/play/entity_velocity.rs index ce85979a6..6f1f755d2 100644 --- a/pumpkin-protocol/src/client/play/entity_velocity.rs +++ b/pumpkin-protocol/src/client/play/entity_velocity.rs @@ -12,8 +12,8 @@ pub struct CEntityVelocity<'a> { velocity: Vec3, } -impl CEntityVelocity { - pub fn new(entity_id: VarInt, velocity_x: f64, velocity_y: f64, velocity_z: f64) -> Self { +impl<'a> CEntityVelocity<'a> { + pub fn new(entity_id: &'a VarInt, velocity_x: f64, velocity_y: f64, velocity_z: f64) -> Self { Self { entity_id, velocity: Vec3::new( diff --git a/pumpkin-protocol/src/client/play/player_position.rs b/pumpkin-protocol/src/client/play/player_position.rs index ad39181f3..853860f7e 100644 --- a/pumpkin-protocol/src/client/play/player_position.rs +++ b/pumpkin-protocol/src/client/play/player_position.rs @@ -9,8 +9,8 @@ use pumpkin_util::math::vec3::Vec3; #[packet(PLAY_PLAYER_POSITION)] pub struct CPlayerPosition<'a> { pub teleport_id: VarInt, - pub position: Vector3, - pub delta: Vector3, + pub position: Vec3, + pub delta: Vec3, pub yaw: f32, pub pitch: f32, pub releatives: &'a [PositionFlag], @@ -40,8 +40,8 @@ impl ServerPacket for CPlayerPosition<'_> { fn read(bytebuf: &mut impl bytes::Buf) -> Result { fn get_vec( bytebuf: &mut impl bytes::Buf, - ) -> Result, crate::bytebuf::ReadingError> { - Ok(Vector3::new( + ) -> Result, crate::bytebuf::ReadingError> { + Ok(Vec3::new( bytebuf.try_get_f64()?, bytebuf.try_get_f64()?, bytebuf.try_get_f64()?,