Skip to content

Commit

Permalink
Fix and Format
Browse files Browse the repository at this point in the history
  • Loading branch information
zp3x committed Jul 30, 2024
1 parent 3ba4ace commit a1b08a6
Showing 1 changed file with 9 additions and 26 deletions.
35 changes: 9 additions & 26 deletions pumpkin/src/protocol/client/play/mod.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
use std::io::Write;

use crate::{
entity::player::GameMode,
protocol::{ClientPacket, VarInt},
};

pub struct SetHeldItem {
slot: i8
slot: i8,
}

impl SetHeldItem {
pub fn new(slot: i8) -> Self {
Self {
slot
}
Self { slot }
}
}

Expand All @@ -28,19 +25,15 @@ impl ClientPacket for SetHeldItem {
pub struct CPlayerAbilities {
flags: i8,
flying_speed: f32,
field_of_view: f32
field_of_view: f32,
}

impl CPlayerAbilities {
pub fn new(
flags: i8,
flying_speed: f32,
field_of_view: f32
) -> Self {
pub fn new(flags: i8, flying_speed: f32, field_of_view: f32) -> Self {
Self {
flags,
flying_speed,
field_of_view
field_of_view,
}
}
}
Expand All @@ -56,24 +49,14 @@ impl ClientPacket for CPlayerAbilities {
}

pub struct CChangeDifficulty {

difficulty: u8,
locked: bool

locked: bool,
}

impl CChangeDifficulty {
pub fn new(
difficulty: u8,
locked: bool
) -> Self {

Self {
difficulty,
locked
}

}
pub fn new(difficulty: u8, locked: bool) -> Self {
Self { difficulty, locked }
}
}

impl ClientPacket for CChangeDifficulty {
Expand Down

0 comments on commit a1b08a6

Please sign in to comment.