Add Clientbound Game Event
This commit is contained in:
1 parent
1f041cc7db
commit
cc527c26ea
2 files changed
+23
-2
No files matched your search
@@ -168,4 +168,22 @@ impl ClientPacket for CLogin {
|
||||
}
|
||||
}
|
||||
|
||||
pub struct CGameEvent {
|
||||
event: u8,
|
||||
value: f32,
|
||||
}
|
||||
|
||||
impl CGameEvent {
|
||||
pub fn new(event: u8, value: f32) -> Self {
|
||||
Self { event, value }
|
||||
}
|
||||
}
|
||||
|
||||
impl ClientPacket for CGameEvent {
|
||||
const PACKET_ID: VarInt = 0x22;
|
||||
|
||||
fn write(&self, bytebuf: &mut ByteBuffer) {
|
||||
bytebuf.put_u8(self.event);
|
||||
bytebuf.put_f32(self.value);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user