Fix and Format

This commit is contained in:
zp3x 2024-07-30 22:38:03 +02:00
parent 3ba4acecd7
commit a1b08a66dd

View File

@ -1,4 +1,3 @@
use std::io::Write;
use crate::{ use crate::{
entity::player::GameMode, entity::player::GameMode,
@ -6,14 +5,12 @@ use crate::{
}; };
pub struct SetHeldItem { pub struct SetHeldItem {
slot: i8 slot: i8,
} }
impl SetHeldItem { impl SetHeldItem {
pub fn new(slot: i8) -> Self { pub fn new(slot: i8) -> Self {
Self { Self { slot }
slot
}
} }
} }
@ -28,19 +25,15 @@ impl ClientPacket for SetHeldItem {
pub struct CPlayerAbilities { pub struct CPlayerAbilities {
flags: i8, flags: i8,
flying_speed: f32, flying_speed: f32,
field_of_view: f32 field_of_view: f32,
} }
impl CPlayerAbilities { impl CPlayerAbilities {
pub fn new( pub fn new(flags: i8, flying_speed: f32, field_of_view: f32) -> Self {
flags: i8,
flying_speed: f32,
field_of_view: f32
) -> Self {
Self { Self {
flags, flags,
flying_speed, flying_speed,
field_of_view field_of_view,
} }
} }
} }
@ -56,24 +49,14 @@ impl ClientPacket for CPlayerAbilities {
} }
pub struct CChangeDifficulty { pub struct CChangeDifficulty {
difficulty: u8, difficulty: u8,
locked: bool locked: bool,
} }
impl CChangeDifficulty { impl CChangeDifficulty {
pub fn new( pub fn new(difficulty: u8, locked: bool) -> Self {
difficulty: u8, Self { difficulty, locked }
locked: bool }
) -> Self {
Self {
difficulty,
locked
}
}
} }
impl ClientPacket for CChangeDifficulty { impl ClientPacket for CChangeDifficulty {