Add Clientbound ChangeDifficulty Packet
This commit is contained in:
parent
0632d4a60a
commit
ad89862f9f
@ -3,6 +3,35 @@ use crate::{
|
|||||||
protocol::{ClientPacket, VarInt},
|
protocol::{ClientPacket, VarInt},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
pub struct CChangeDifficulty {
|
||||||
|
|
||||||
|
difficulty: u8,
|
||||||
|
locked: bool
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
impl CChangeDifficulty {
|
||||||
|
pub fn new(
|
||||||
|
difficulty: u8,
|
||||||
|
locked: bool
|
||||||
|
) -> Self {
|
||||||
|
|
||||||
|
Self {
|
||||||
|
difficulty,
|
||||||
|
locked
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ClientPacket for CChangeDifficulty {
|
||||||
|
const PACKET_ID: VarInt = 0x0B;
|
||||||
|
|
||||||
|
fn write(&self, bytebuf: &mut crate::protocol::bytebuf::buffer::ByteBuffer) {
|
||||||
|
bytebuf.write_u8(self.difficulty);
|
||||||
|
bytebuf.write_bool(self.locked);
|
||||||
|
}
|
||||||
|
}
|
||||||
pub struct CLogin {
|
pub struct CLogin {
|
||||||
entity_id: i32,
|
entity_id: i32,
|
||||||
is_hardcore: bool,
|
is_hardcore: bool,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user